Loading opds_catalog/__pycache__/dl.cpython-35.pyc +83 B (3.23 KiB) File changed.No diff preview for this file type. View original file View changed file opds_catalog/__pycache__/feeds.cpython-35.pyc +165 B (38.3 KiB) File changed.No diff preview for this file type. View original file View changed file opds_catalog/__pycache__/urls.cpython-35.pyc +9 B (2.75 KiB) File changed.No diff preview for this file type. View original file View changed file opds_catalog/dl.py +2 −0 Original line number Diff line number Diff line Loading @@ -15,6 +15,8 @@ def Download(request, book_id, zip = 0): """ Загрузка файла книги """ book = Book.objects.get(id=book_id) # TODO: Добавить книгу на книжную полку if settings.AUTH: bookshelf.objects.get_or_create(user=request.user, book=book) full_path=os.path.join(settings.ROOT_LIB,book.path) if settings.TITLE_AS_FILENAME: Loading opds_catalog/feeds.py +10 −3 Original line number Diff line number Diff line Loading @@ -158,7 +158,7 @@ class MainFeed(AuthFeed): if settings.AUTH and self.request.user.is_authenticated(): mainitems += [ {"id":6, "title":_("%(username)s Book shelf")%({"username":self.request.user.username}), "link":"opds_catalog:bookshelf", "descr":_("%(username)s books readed: %(bookshelf)s."),"counters":{"bookshelf":bookshelf.objects.count(),"username":self.request.user.username}}, "descr":_("%(username)s books readed: %(bookshelf)s."),"counters":{"bookshelf":bookshelf.objects.filter(user=self.request.user).count(),"username":self.request.user.username}}, ] return mainitems Loading Loading @@ -375,6 +375,14 @@ class SearchBooksFeed(AuthFeed): except: genre_id = 0 books = Book.objects.filter(genres=genre_id) # Поиск книг на книжной полке elif searchtype == 'u': if settings.AUTH: books = Book.objects\ .filter(bookshelf__user=self.request.user)\ .order_by('-readtime') else: books={} return {"books":books, "searchterms":searchterms, "searchterms0":searchterms0, "searchtype":searchtype, "page":page} Loading Loading @@ -903,4 +911,3 @@ class GenresFeed(AuthFeed): def item_enclosures(self, item): return (opdsEnclosure(self.item_link(item),"application/atom+xml;profile=opds-catalog;kind=navigation", "subsection"),) No newline at end of file Loading
opds_catalog/__pycache__/dl.cpython-35.pyc +83 B (3.23 KiB) File changed.No diff preview for this file type. View original file View changed file
opds_catalog/__pycache__/feeds.cpython-35.pyc +165 B (38.3 KiB) File changed.No diff preview for this file type. View original file View changed file
opds_catalog/__pycache__/urls.cpython-35.pyc +9 B (2.75 KiB) File changed.No diff preview for this file type. View original file View changed file
opds_catalog/dl.py +2 −0 Original line number Diff line number Diff line Loading @@ -15,6 +15,8 @@ def Download(request, book_id, zip = 0): """ Загрузка файла книги """ book = Book.objects.get(id=book_id) # TODO: Добавить книгу на книжную полку if settings.AUTH: bookshelf.objects.get_or_create(user=request.user, book=book) full_path=os.path.join(settings.ROOT_LIB,book.path) if settings.TITLE_AS_FILENAME: Loading
opds_catalog/feeds.py +10 −3 Original line number Diff line number Diff line Loading @@ -158,7 +158,7 @@ class MainFeed(AuthFeed): if settings.AUTH and self.request.user.is_authenticated(): mainitems += [ {"id":6, "title":_("%(username)s Book shelf")%({"username":self.request.user.username}), "link":"opds_catalog:bookshelf", "descr":_("%(username)s books readed: %(bookshelf)s."),"counters":{"bookshelf":bookshelf.objects.count(),"username":self.request.user.username}}, "descr":_("%(username)s books readed: %(bookshelf)s."),"counters":{"bookshelf":bookshelf.objects.filter(user=self.request.user).count(),"username":self.request.user.username}}, ] return mainitems Loading Loading @@ -375,6 +375,14 @@ class SearchBooksFeed(AuthFeed): except: genre_id = 0 books = Book.objects.filter(genres=genre_id) # Поиск книг на книжной полке elif searchtype == 'u': if settings.AUTH: books = Book.objects\ .filter(bookshelf__user=self.request.user)\ .order_by('-readtime') else: books={} return {"books":books, "searchterms":searchterms, "searchterms0":searchterms0, "searchtype":searchtype, "page":page} Loading Loading @@ -903,4 +911,3 @@ class GenresFeed(AuthFeed): def item_enclosures(self, item): return (opdsEnclosure(self.item_link(item),"application/atom+xml;profile=opds-catalog;kind=navigation", "subsection"),) No newline at end of file