Commit 923eaea8 authored by mitshel's avatar mitshel
Browse files

Добавлен показ обложек в сортировке "По Каталогам"

parent 5c4773d0
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -213,7 +213,7 @@ if type_value==0:
#
elif type_value==1:
   header()
   for (item_type,item_id,item_name,item_path,reg_date,item_title) in opdsdb.getitemsincat(slice_value,cfg.MAXITEMS,page_value):
   for (item_type,item_id,item_name,item_path,reg_date,item_title,cover,cover_type) in opdsdb.getitemsincat(slice_value,cfg.MAXITEMS,page_value):
       if item_type==1:
          id='01'+str(item_id)
       elif item_type==2:
@@ -224,6 +224,7 @@ elif type_value==1:
       entry_head(item_title, reg_date, id_value)
       entry_link_subsection(id)
       if item_type==2:
          entry_covers(cover,cover_type,item_id)
          entry_authors(opdsdb,item_id)
       entry_finish()
   page_control(opdsdb,page_value,id_value)
+2 −2
Original line number Diff line number Diff line
@@ -302,8 +302,8 @@ class opdsDatabase:
       limitstr=""
    else:
       limitstr="limit "+str(limit*page)+","+str(limit)
    sql_finditems=("select SQL_CALC_FOUND_ROWS 1,cat_id,cat_name,path,now(),cat_name as title from "+TBL_CATALOGS+" where parent_id="+str(cat_id)+" union all "
    "select 2,book_id,filename,path,registerdate,title from "+TBL_BOOKS+" where cat_id="+str(cat_id)+" and avail!=0 order by 1,6 "+limitstr)
    sql_finditems=("select SQL_CALC_FOUND_ROWS 1,cat_id,cat_name,path,now(),cat_name as title,'' as cover, '' as cover_type from "+TBL_CATALOGS+" where parent_id="+str(cat_id)+" union all "
    "select 2,book_id,filename,path,registerdate,title,cover,cover_type from "+TBL_BOOKS+" where cat_id="+str(cat_id)+" and avail!=0 order by 1,6 "+limitstr)
    cursor=self.cnx.cursor()
    cursor.execute(sql_finditems)
    rows=cursor.fetchall()