Loading opds_catalog/__pycache__/feeds.cpython-35.pyc +126 B (26.2 KiB) File changed.No diff preview for this file type. View original file View changed file opds_catalog/__pycache__/sopdscan.cpython-35.pyc +7 B (7.04 KiB) File changed.No diff preview for this file type. View original file View changed file opds_catalog/feeds.py +6 −6 Original line number Diff line number Diff line Loading @@ -577,16 +577,16 @@ class AuthorsFeed(AuthFeed): def items(self, obj): length, chars = obj if self.lang_code: sql="""select upper(substr(last_name,1,%(length)s)) as id, count(*) as cnt sql="""select upper(substr(last_name || ' ' || first_name,1,%(length)s)) as id, count(*) as cnt from opds_catalog_author where lang_code=%(lang_code)s and upper(last_name) like '%(chars)s%%' group by upper(substr(last_name,1,%(length)s)) where lang_code=%(lang_code)s and upper(last_name || ' ' || first_name) like '%(chars)s%%' group by upper(substr(last_name || ' ' || first_name,1,%(length)s)) order by id"""%{'length':length, 'lang_code':self.lang_code, 'chars':chars} else: sql="""select upper(substr(last_name,1,%(length)s)) as id, count(*) as cnt sql="""select upper(substr(last_name || ' ' || first_name,1,%(length)s)) as id, count(*) as cnt from opds_catalog_author where upper(last_name) like '%(chars)s%%' group by upper(substr(last_name,1,%(length)s)) where upper(last_name || ' ' || first_name) like '%(chars)s%%' group by upper(substr(last_name || ' ' || first_name,1,%(length)s)) order by id"""%{'length':length,'chars':chars} dataset = Author.objects.raw(sql) Loading opds_catalog/sopdscan.py +3 −3 Original line number Diff line number Diff line Loading @@ -186,13 +186,13 @@ class opdsScanner: idx=0 for l in self.fb2parser.author_last.getvalue(): last_name=l.strip(' \'\"\&-.#\\\`') first_name=self.fb2parser.author_first.getvalue()[idx].strip(' \'\"\&-.#\\\`') last_name=l.strip(' \n\'\"\&-.#\\\`') first_name=self.fb2parser.author_first.getvalue()[idx].strip(' \n\'\"\&-.#\\\`') author=opdsdb.addauthor(first_name,last_name) opdsdb.addbauthor(book,author) idx+=1 for l in self.fb2parser.genre.getvalue(): opdsdb.addbgenre(book,opdsdb.addgenre(l.lower().strip(' \'\"'))) opdsdb.addbgenre(book,opdsdb.addgenre(l.lower().strip(' \n\'\"'))) for l in self.fb2parser.series.attrss: ser_name=l.get('name') if ser_name: Loading Loading
opds_catalog/__pycache__/feeds.cpython-35.pyc +126 B (26.2 KiB) File changed.No diff preview for this file type. View original file View changed file
opds_catalog/__pycache__/sopdscan.cpython-35.pyc +7 B (7.04 KiB) File changed.No diff preview for this file type. View original file View changed file
opds_catalog/feeds.py +6 −6 Original line number Diff line number Diff line Loading @@ -577,16 +577,16 @@ class AuthorsFeed(AuthFeed): def items(self, obj): length, chars = obj if self.lang_code: sql="""select upper(substr(last_name,1,%(length)s)) as id, count(*) as cnt sql="""select upper(substr(last_name || ' ' || first_name,1,%(length)s)) as id, count(*) as cnt from opds_catalog_author where lang_code=%(lang_code)s and upper(last_name) like '%(chars)s%%' group by upper(substr(last_name,1,%(length)s)) where lang_code=%(lang_code)s and upper(last_name || ' ' || first_name) like '%(chars)s%%' group by upper(substr(last_name || ' ' || first_name,1,%(length)s)) order by id"""%{'length':length, 'lang_code':self.lang_code, 'chars':chars} else: sql="""select upper(substr(last_name,1,%(length)s)) as id, count(*) as cnt sql="""select upper(substr(last_name || ' ' || first_name,1,%(length)s)) as id, count(*) as cnt from opds_catalog_author where upper(last_name) like '%(chars)s%%' group by upper(substr(last_name,1,%(length)s)) where upper(last_name || ' ' || first_name) like '%(chars)s%%' group by upper(substr(last_name || ' ' || first_name,1,%(length)s)) order by id"""%{'length':length,'chars':chars} dataset = Author.objects.raw(sql) Loading
opds_catalog/sopdscan.py +3 −3 Original line number Diff line number Diff line Loading @@ -186,13 +186,13 @@ class opdsScanner: idx=0 for l in self.fb2parser.author_last.getvalue(): last_name=l.strip(' \'\"\&-.#\\\`') first_name=self.fb2parser.author_first.getvalue()[idx].strip(' \'\"\&-.#\\\`') last_name=l.strip(' \n\'\"\&-.#\\\`') first_name=self.fb2parser.author_first.getvalue()[idx].strip(' \n\'\"\&-.#\\\`') author=opdsdb.addauthor(first_name,last_name) opdsdb.addbauthor(book,author) idx+=1 for l in self.fb2parser.genre.getvalue(): opdsdb.addbgenre(book,opdsdb.addgenre(l.lower().strip(' \'\"'))) opdsdb.addbgenre(book,opdsdb.addgenre(l.lower().strip(' \n\'\"'))) for l in self.fb2parser.series.attrss: ser_name=l.get('name') if ser_name: Loading