Loading opds_catalog/dl.py +2 −2 Original line number Diff line number Diff line Loading @@ -16,7 +16,7 @@ def Download(request, book_id, zip_flag): """ Загрузка файла книги """ book = Book.objects.get(id=book_id) if settings.AUTH: if settings.AUTH and request.user.is_authenticated(): bookshelf.objects.get_or_create(user=request.user, book=book) full_path=os.path.join(settings.ROOT_LIB,book.path) Loading Loading @@ -149,7 +149,7 @@ def ConvertFB2(request, book_id, convert_type): if book.format!='fb2': raise Http404 if settings.AUTH: if settings.AUTH and request.user.is_authenticated(): bookshelf.objects.get_or_create(user=request.user, book=book) full_path=os.path.join(settings.ROOT_LIB,book.path) Loading opds_catalog/feeds.py +4 −0 Original line number Diff line number Diff line Loading @@ -19,6 +19,10 @@ class AuthFeed(Feed): request = None def __call__(self,request,*args,**kwargs): self.request = request if settings.AUTH: if request.user.is_authenticated(): return super().__call__(request,*args,**kwargs) bau = BasicAuthMiddleware() result=bau.process_request(self.request) Loading Loading
opds_catalog/dl.py +2 −2 Original line number Diff line number Diff line Loading @@ -16,7 +16,7 @@ def Download(request, book_id, zip_flag): """ Загрузка файла книги """ book = Book.objects.get(id=book_id) if settings.AUTH: if settings.AUTH and request.user.is_authenticated(): bookshelf.objects.get_or_create(user=request.user, book=book) full_path=os.path.join(settings.ROOT_LIB,book.path) Loading Loading @@ -149,7 +149,7 @@ def ConvertFB2(request, book_id, convert_type): if book.format!='fb2': raise Http404 if settings.AUTH: if settings.AUTH and request.user.is_authenticated(): bookshelf.objects.get_or_create(user=request.user, book=book) full_path=os.path.join(settings.ROOT_LIB,book.path) Loading
opds_catalog/feeds.py +4 −0 Original line number Diff line number Diff line Loading @@ -19,6 +19,10 @@ class AuthFeed(Feed): request = None def __call__(self,request,*args,**kwargs): self.request = request if settings.AUTH: if request.user.is_authenticated(): return super().__call__(request,*args,**kwargs) bau = BasicAuthMiddleware() result=bau.process_request(self.request) Loading