Commit d9265423 authored by Dmitry Shelepnev's avatar Dmitry Shelepnev
Browse files

Fix pagination for Authors and series search in views and feeds

parent daf48105
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -633,7 +633,7 @@ class SearchAuthorsFeed(AuthFeed):
        op = OPDS_Paginator(authors_count, 0, page_num, settings.MAXITEMS)        
        items = []
        
        for row in authors:
        for row in authors[op.d1_first_pos:op.d1_last_pos+1]:
            p = {'id':row.id, 'full_name':row.full_name, 'lang_code': row.lang_code, 'book_count': Book.objects.filter(authors=row).count()}
            items.append(p)    
                                
@@ -711,7 +711,7 @@ class SearchSeriesFeed(AuthFeed):
        op = OPDS_Paginator(series_count, 0, page_num, settings.MAXITEMS)        
        items = []
        
        for row in series:
        for row in series[op.d1_first_pos:op.d1_last_pos+1]:
            p = {'id':row.id, 'ser':row.ser, 'lang_code': row.lang_code, 'book_count': row.count_book}
            items.append(p)   
        
+0 −1
Original line number Diff line number Diff line
@@ -157,7 +157,6 @@ SOPDS_AUTH = True
SOPDS_SCAN_SHED_MIN ='0'
SOPDS_SCAN_SHED_HOUR ='0,12'
SOPDS_INPX_ENABLE = False
SOPDS_MAXITEMS = 4

#Конвертеры EPUB и MOBI
#SOPDS_FB2TOEPUB = os.path.join(BASE_DIR,'convert/fb2toepub/unix_dist/fb2toepub')
+2 −2
Original line number Diff line number Diff line
@@ -251,7 +251,7 @@ def SearchSeriesView(request):
        series_count = series.count()
        op = OPDS_Paginator(series_count, 0, page_num, MAXITEMS, HALF_PAGES_LINKS)        
        items = []
        for row in series:
        for row in series[op.d1_first_pos:op.d1_last_pos+1]:
            #p = {'id':row.id, 'ser':row.ser, 'lang_code': row.lang_code, 'book_count': Book.objects.filter(series=row).count()}
            p = {'id':row.id, 'ser':row.ser, 'lang_code': row.lang_code, 'book_count': row.count_book}
            items.append(p)                     
@@ -290,7 +290,7 @@ def SearchAuthorsView(request):
        op = OPDS_Paginator(authors_count, 0, page_num, MAXITEMS, HALF_PAGES_LINKS)        
        items = []
        
        for row in authors:
        for row in authors[op.d1_first_pos:op.d1_last_pos+1]:
            p = {'id':row.id, 'full_name':row.full_name, 'lang_code': row.lang_code, 'book_count': Book.objects.filter(authors=row).count()}
            items.append(p)