Commit e0b80273 authored by mitshel's avatar mitshel
Browse files

Исправление ошибок

parent 37f0879a
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -53,7 +53,7 @@ fb2hsize = 0
zipscan    = yes

# ziprescan = no - Предотвращает повторное сканирование всего zip-архива
ziprescan  = yes
ziprescan  = no

# Указываем какая кодировка для названий файлов используется в ZIP-архивах
# доступные кодировки: cp437, cp866, cp1251, utf-8
+10 −3
Original line number Diff line number Diff line
@@ -492,7 +492,14 @@ elif type_value==7:
       if len(authors)>0:
             authors+=', '
       authors+=last_name+' '+first_name
   enc_print('<content type="text"> Название книги: '+title+'\nАвтор(ы): '+authors+'\nРазмер файла : '+str(fsize//1000)+'Кб</content>')
   genres=""
   for (section,genre) in opdsdb.getgenres(slice_value):
       enc_print('<category term="%s" label="%s" />'%(genre,genre))
       if len(genres)>0:
             genres+=', '
       genres+=genre

   enc_print('<content type="text"> Название книги: '+title+'\nАвтор(ы): '+authors+'\nЖанры: '+genres+'\nРазмер файла : '+str(fsize//1000)+'Кб</content>')
   
   enc_print('<updated>'+reg_date.strftime("%Y-%m-%dT%H:%M:%SZ")+'</updated>')
   enc_print('<id>tag:book:'+id+'</id>')
@@ -618,10 +625,10 @@ elif type_value==99:
           c0=0

   if c0==0: 
      if os.path.exists(cfg.NOCOVER_IMG):
      if os.path.exists(sopdscfg.NOCOVER_IMG):
         enc_print('Content-Type: image/jpeg')
         enc_print()
         f=open(cfg.NOCOVER_IMG,"rb")
         f=open(sopdscfg.NOCOVER_IMG,"rb")
         sys.stdout.buffer.write(f.read())
         f.close()
      else:
+8 −0
Original line number Diff line number Diff line
@@ -327,6 +327,14 @@ class opdsDatabase:
    cursor.close
    return rows

  def getgenres(self,book_id):
    sql=("select section, subsection from "+TBL_GENRES+" a, "+TBL_BGENRES+" b where b.genre_id=a.genre_id and b.book_id="+str(book_id))
    cursor=self.cnx.cursor()
    cursor.execute(sql)
    rows=cursor.fetchall()
    cursor.close
    return rows

  def getauthor_2letters(self,letters):
    lc=len(letters)+1
    sql="select UPPER(substring(trim(CONCAT(last_name,' ',first_name)),1,"+str(lc)+")) as letters, count(*) as cnt from "+TBL_AUTHORS+" where UPPER(substring(trim(CONCAT(last_name,' ',first_name)),1,"+str(lc-1)+"))='"+letters+"' group by 1 order by 1"