inital cbr support
This commit is contained in:
parent
60ab6a5244
commit
6d19dd5e81
6 changed files with 44 additions and 4 deletions
|
|
@ -10,6 +10,7 @@ import codecs
|
|||
import ox
|
||||
|
||||
from . import pdf
|
||||
from . import cbr
|
||||
from . import epub
|
||||
from . import txt
|
||||
from . import opf
|
||||
|
|
@ -27,10 +28,12 @@ def metadata(f, from_=None):
|
|||
data['extension'] = ext
|
||||
data['size'] = os.stat(f).st_size
|
||||
|
||||
if ext == 'pdf':
|
||||
info = pdf.info(f)
|
||||
if ext == 'cbr':
|
||||
info = cbr.info(f)
|
||||
elif ext == 'epub':
|
||||
info = epub.info(f)
|
||||
elif ext == 'pdf':
|
||||
info = pdf.info(f)
|
||||
elif ext == 'txt':
|
||||
info = txt.info(f)
|
||||
|
||||
|
|
|
|||
18
oml/media/cbr.py
Normal file
18
oml/media/cbr.py
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
# vi:si:et:sw=4:sts=4:ts=4
|
||||
|
||||
|
||||
import os
|
||||
|
||||
|
||||
def cover(path):
|
||||
data = None
|
||||
#open rar file and extract first page here
|
||||
return data
|
||||
|
||||
def info(path):
|
||||
data = {}
|
||||
data['title'] = os.path.splitext(os.path.basename(path))[0]
|
||||
#data['pages'] = fixme read rar to count pages
|
||||
return data
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue