Compare commits
No commits in common. "3ec0930f5292424f13c39f2b3c4fc99275da93ae" and "760494dd6d2fc59f58ef0e4118e798aaeec5a83c" have entirely different histories.
3ec0930f52
...
760494dd6d
7 changed files with 5 additions and 61 deletions
8
ctl
8
ctl
|
|
@ -37,7 +37,7 @@ if [ ! -e "$PID" ]; then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
PLATFORM_PYTHON=3.4
|
PLATFORM_PYTHON=3.4
|
||||||
SHARED_PYTHON=3.7
|
SHARED_PYTHON=3.4
|
||||||
if [ -e "$BASE/platform_local" ]; then
|
if [ -e "$BASE/platform_local" ]; then
|
||||||
export PLATFORM_ENV="$BASE/platform_local"
|
export PLATFORM_ENV="$BASE/platform_local"
|
||||||
else
|
else
|
||||||
|
|
@ -56,16 +56,10 @@ else
|
||||||
ARCH="_armv7l"
|
ARCH="_armv7l"
|
||||||
fi
|
fi
|
||||||
PLATFORM="linux$ARCH"
|
PLATFORM="linux$ARCH"
|
||||||
if [ -e $BASE/platform_${PLATFORM}/lib/libunrar.so ]; then
|
|
||||||
export UNRAR_LIB_PATH="$BASE/platform_${PLATFORM}/lib/libunrar.so"
|
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
if [ $SYSTEM == "Darwin" ]; then
|
if [ $SYSTEM == "Darwin" ]; then
|
||||||
PLATFORM="darwin64"
|
PLATFORM="darwin64"
|
||||||
PLATFORM_PYTHON=3.7
|
PLATFORM_PYTHON=3.7
|
||||||
if [ -e $BASE/platform_${PLATFORM}/lib/libunrar.dylib ]; then
|
|
||||||
export UNRAR_LIB_PATH="$BASE/platform_${PLATFORM}/lib/libunrar.dylib"
|
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
export PLATFORM_ENV="$BASE/platform_${PLATFORM}"
|
export PLATFORM_ENV="$BASE/platform_${PLATFORM}"
|
||||||
fi
|
fi
|
||||||
|
|
|
||||||
|
|
@ -17,9 +17,6 @@ if sys.platform == 'win32':
|
||||||
site.addsitedir(site_packages)
|
site.addsitedir(site_packages)
|
||||||
sys.path.append(join(base, 'platform_win32'))
|
sys.path.append(join(base, 'platform_win32'))
|
||||||
os.environ['oxCACHE'] = join(base, 'data', 'ox')
|
os.environ['oxCACHE'] = join(base, 'data', 'ox')
|
||||||
unrar_dll = join(base, 'platform_win32', 'unrar.dll')
|
|
||||||
if os.path.exists(unrar_dll):
|
|
||||||
os.environ['UNRAR_LIB_PATH'] = unrar_dll
|
|
||||||
|
|
||||||
import api
|
import api
|
||||||
import commands
|
import commands
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@ import ox
|
||||||
|
|
||||||
from . import pdf
|
from . import pdf
|
||||||
from . import cbr
|
from . import cbr
|
||||||
from . import cbz
|
cbz = cbr
|
||||||
from . import epub
|
from . import epub
|
||||||
from . import txt
|
from . import txt
|
||||||
from . import opf
|
from . import opf
|
||||||
|
|
@ -34,10 +34,8 @@ def metadata(f, from_=None):
|
||||||
data['size'] = os.stat(f).st_size
|
data['size'] = os.stat(f).st_size
|
||||||
|
|
||||||
try:
|
try:
|
||||||
if ext in ('cbr', ):
|
if ext in ('cbr', 'cbz'):
|
||||||
info = cbr.info(f)
|
info = cbr.info(f)
|
||||||
elif ext in ('cbz', ):
|
|
||||||
info = cbz.info(f)
|
|
||||||
elif ext in ('epub', 'kepub'):
|
elif ext in ('epub', 'kepub'):
|
||||||
info = epub.info(f)
|
info = epub.info(f)
|
||||||
data['extension'] = 'epub'
|
data['extension'] = 'epub'
|
||||||
|
|
|
||||||
|
|
@ -2,23 +2,11 @@
|
||||||
|
|
||||||
|
|
||||||
import os
|
import os
|
||||||
import ox
|
|
||||||
|
|
||||||
def cover(path):
|
def cover(path):
|
||||||
data = None
|
data = None
|
||||||
#open rar file and extract first page here
|
#open rar file and extract first page here
|
||||||
try:
|
|
||||||
from unrar import rarfile
|
|
||||||
rar = rarfile.RarFile(path)
|
|
||||||
for cover in ox.sorted_strings(rar.namelist()):
|
|
||||||
try:
|
|
||||||
data = rar.read(cover)
|
|
||||||
except:
|
|
||||||
data = None
|
|
||||||
finally:
|
|
||||||
return data
|
|
||||||
except:
|
|
||||||
data = None
|
|
||||||
return data
|
return data
|
||||||
|
|
||||||
def info(path):
|
def info(path):
|
||||||
|
|
|
||||||
|
|
@ -1,32 +0,0 @@
|
||||||
# -*- coding: utf-8 -*-
|
|
||||||
import os
|
|
||||||
import zipfile
|
|
||||||
|
|
||||||
import ox
|
|
||||||
|
|
||||||
def cover(path):
|
|
||||||
data = None
|
|
||||||
logger.debug('cover %s', path)
|
|
||||||
data = None
|
|
||||||
try:
|
|
||||||
z = zipfile.ZipFile(path)
|
|
||||||
except zipfile.BadZipFile:
|
|
||||||
logger.debug('invalid zbc file %s', path)
|
|
||||||
return data
|
|
||||||
files = [f.filename for f in z.filelist]
|
|
||||||
if files:
|
|
||||||
for cover in ox.sortedstrings(files):
|
|
||||||
try:
|
|
||||||
data = z.read(cover)
|
|
||||||
except:
|
|
||||||
data = None
|
|
||||||
finally:
|
|
||||||
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
|
|
||||||
|
|
||||||
|
|
@ -10,4 +10,3 @@ pysocks
|
||||||
stem
|
stem
|
||||||
sqlitedict==1.6.0
|
sqlitedict==1.6.0
|
||||||
zeroconf
|
zeroconf
|
||||||
unrar
|
|
||||||
|
|
|
||||||
|
|
@ -338,7 +338,7 @@ oml.ui.folders = function() {
|
||||||
that.updateOwnLists = function(callback) {
|
that.updateOwnLists = function(callback) {
|
||||||
oml.getLists(function(lists) {
|
oml.getLists(function(lists) {
|
||||||
var items = lists.filter(function(list) {
|
var items = lists.filter(function(list) {
|
||||||
return list.user == '' && list.type != 'library' && list.name != 'Inbox';
|
return list.user == '' && list.type != 'library';
|
||||||
});
|
});
|
||||||
oml.$ui.folder[0].$content
|
oml.$ui.folder[0].$content
|
||||||
.css({height: 16 + items.length * 16 + 'px'});
|
.css({height: 16 + items.length * 16 + 'px'});
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue