Loading py/__pycache__/sopdsdb.cpython-33.pyc +27 B (25.3 KiB) File changed.No diff preview for this file type. View original file View changed file py/__pycache__/sopdsparse.cpython-33.pyc +221 B (10.2 KiB) File changed.No diff preview for this file type. View original file View changed file py/sopds-scan.py +5 −2 Original line number Diff line number Diff line Loading @@ -107,7 +107,8 @@ def processfile(db,fb2,name,full_path,file,archive=0,file_size=0,cat_id=0): cat_id=db.addcattree(rel_path,archive) title='' lang='' annotation=''; annotation='' docdate='' if e.lower()=='.fb2' and cfg.FB2PARSE: if isinstance(file, str): Loading @@ -123,6 +124,8 @@ def processfile(db,fb2,name,full_path,file,archive=0,file_size=0,cat_id=0): title=fb2.book_title.getvalue()[0].strip(' \'\"\&-.#\\\`') if len(fb2.annotation.getvalue())>0: annotation=('\n'.join(fb2.annotation.getvalue()))[:10000] if len(fb2.docdate.getvalue())>0: docdate=fb2.docdate.getvalue()[0].strip(); if VERBOSE: if fb2.parse_error!=0: Loading @@ -131,7 +134,7 @@ def processfile(db,fb2,name,full_path,file,archive=0,file_size=0,cat_id=0): if title=='': title=n book_id=opdsdb.addbook(name,rel_path,cat_id,e,title,annotation,lang,file_size,archive,cfg.DUBLICATES_FIND) book_id=opdsdb.addbook(name,rel_path,cat_id,e,title,annotation,docdate,lang,file_size,archive,cfg.DUBLICATES_FIND) books_added+=1 if e.lower()=='.fb2' and cfg.FB2PARSE and cfg.COVER_EXTRACT: Loading py/sopds.cgi +2 −2 Original line number Diff line number Diff line Loading @@ -41,7 +41,7 @@ def websym(s,attr=False): """Replace special web-symbols""" result = s if attr: table = {'&':'&','<':'<','"':'\''} table = {'"':'\''} else: table = {'&':'&','<':'<'} for k in table.keys(): Loading Loading @@ -175,7 +175,7 @@ def entry_covers(cover,cover_type,book_id): enc_print( '<link href="%s?id=%s" rel="x-stanza-cover-image-thumbnail" type="image/jpeg" />'%(cfg.CGI_PATH,id) ) def entry_content(e_content): enc_print('<content type="text">'+e_content+'</content>') enc_print('<content type="text">'+websym(e_content)+'</content>') def entry_finish(): enc_print('</entry>') Loading py/sopdsdb.py +3 −3 Original line number Diff line number Diff line Loading @@ -118,15 +118,15 @@ class opdsDatabase: cursor.close() return book_id def addbook(self, name, path, cat_id, exten, title, annotation, lang, size=0, archive=0, doublicates=0): def addbook(self, name, path, cat_id, exten, title, annotation, docdate, lang, size=0, archive=0, doublicates=0): format=exten[1:] format=format.lower() if doublicates!=0: doublicat=self.finddouble(title,format,size) else: doublicat=0 sql_addbook=("insert into "+TBL_BOOKS+"(filename,path,cat_id,filesize,format,title,annotation,lang,cat_type,doublicat,avail) VALUES(%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, 2)") data_addbook=(name,path,cat_id,size,format,title,annotation,lang,archive,doublicat) sql_addbook=("insert into "+TBL_BOOKS+"(filename,path,cat_id,filesize,format,title,annotation,docdate,lang,cat_type,doublicat,avail) VALUES(%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, 2)") data_addbook=(name,path,cat_id,size,format,title,annotation,docdate,lang,archive,doublicat) cursor=self.cnx.cursor() cursor.execute(sql_addbook,data_addbook) book_id=cursor.lastrowid Loading Loading
py/__pycache__/sopdsdb.cpython-33.pyc +27 B (25.3 KiB) File changed.No diff preview for this file type. View original file View changed file
py/__pycache__/sopdsparse.cpython-33.pyc +221 B (10.2 KiB) File changed.No diff preview for this file type. View original file View changed file
py/sopds-scan.py +5 −2 Original line number Diff line number Diff line Loading @@ -107,7 +107,8 @@ def processfile(db,fb2,name,full_path,file,archive=0,file_size=0,cat_id=0): cat_id=db.addcattree(rel_path,archive) title='' lang='' annotation=''; annotation='' docdate='' if e.lower()=='.fb2' and cfg.FB2PARSE: if isinstance(file, str): Loading @@ -123,6 +124,8 @@ def processfile(db,fb2,name,full_path,file,archive=0,file_size=0,cat_id=0): title=fb2.book_title.getvalue()[0].strip(' \'\"\&-.#\\\`') if len(fb2.annotation.getvalue())>0: annotation=('\n'.join(fb2.annotation.getvalue()))[:10000] if len(fb2.docdate.getvalue())>0: docdate=fb2.docdate.getvalue()[0].strip(); if VERBOSE: if fb2.parse_error!=0: Loading @@ -131,7 +134,7 @@ def processfile(db,fb2,name,full_path,file,archive=0,file_size=0,cat_id=0): if title=='': title=n book_id=opdsdb.addbook(name,rel_path,cat_id,e,title,annotation,lang,file_size,archive,cfg.DUBLICATES_FIND) book_id=opdsdb.addbook(name,rel_path,cat_id,e,title,annotation,docdate,lang,file_size,archive,cfg.DUBLICATES_FIND) books_added+=1 if e.lower()=='.fb2' and cfg.FB2PARSE and cfg.COVER_EXTRACT: Loading
py/sopds.cgi +2 −2 Original line number Diff line number Diff line Loading @@ -41,7 +41,7 @@ def websym(s,attr=False): """Replace special web-symbols""" result = s if attr: table = {'&':'&','<':'<','"':'\''} table = {'"':'\''} else: table = {'&':'&','<':'<'} for k in table.keys(): Loading Loading @@ -175,7 +175,7 @@ def entry_covers(cover,cover_type,book_id): enc_print( '<link href="%s?id=%s" rel="x-stanza-cover-image-thumbnail" type="image/jpeg" />'%(cfg.CGI_PATH,id) ) def entry_content(e_content): enc_print('<content type="text">'+e_content+'</content>') enc_print('<content type="text">'+websym(e_content)+'</content>') def entry_finish(): enc_print('</entry>') Loading
py/sopdsdb.py +3 −3 Original line number Diff line number Diff line Loading @@ -118,15 +118,15 @@ class opdsDatabase: cursor.close() return book_id def addbook(self, name, path, cat_id, exten, title, annotation, lang, size=0, archive=0, doublicates=0): def addbook(self, name, path, cat_id, exten, title, annotation, docdate, lang, size=0, archive=0, doublicates=0): format=exten[1:] format=format.lower() if doublicates!=0: doublicat=self.finddouble(title,format,size) else: doublicat=0 sql_addbook=("insert into "+TBL_BOOKS+"(filename,path,cat_id,filesize,format,title,annotation,lang,cat_type,doublicat,avail) VALUES(%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, 2)") data_addbook=(name,path,cat_id,size,format,title,annotation,lang,archive,doublicat) sql_addbook=("insert into "+TBL_BOOKS+"(filename,path,cat_id,filesize,format,title,annotation,docdate,lang,cat_type,doublicat,avail) VALUES(%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, 2)") data_addbook=(name,path,cat_id,size,format,title,annotation,docdate,lang,archive,doublicat) cursor=self.cnx.cursor() cursor.execute(sql_addbook,data_addbook) book_id=cursor.lastrowid Loading