Commit 8e0944f0 authored by mitshel's avatar mitshel
Browse files

Несущественные исправления (косметические) в организации поиска.

Казалось что что то не работает (FBReader) при поиске вываливался\ в crash
Оказалось, что FBReader чтото кэширует и при переходе от старой системы поиска к новой нужно было удалить и добавить OPDS-каталог.
parent fd06f4e1
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -2,8 +2,7 @@
<OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/">
  <ShortName>SimpleOPDS</ShortName>
  <LongName>SimpleOPDS</LongName>
  <Description>Simple OPDS Catalog by www.sopds.ru</Description>
  <Url type="application/atom+xml" template="/opds/py/sopds.cgi?search={searchTerms}" />
  <Url type="application/atom+xml;profile=opds-catalog" template="/opds/py/sopds.cgi?search={searchTerms}" />
  <Image width="16" height="16">http://www.sopds.ru/favicon.ico</Image>
  <Tags />
  <Contact />

py/opensearch.xml

deleted100644 → 0
+0 −17
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/">
  <ShortName>SimpleOPDS</ShortName>
  <LongName>SimpleOPDS</LongName>
  <Description>Simple OPDS Catalog by www.sopds.ru</Description>
  <Url type="application/atom+xml" template="/opds/py/sopds.cgi?search={searchTerms}" />
  <Image width="16" height="16">http://www.sopds.ru/favicon.ico</Image>
  <Tags />
  <Contact />
  <Developer />
  <Attribution />
  <SyndicationRight>open</SyndicationRight>
  <AdultContent>false</AdultContent>
  <Language>*</Language>
  <OutputEncoding>UTF-8</OutputEncoding>
  <InputEncoding>UTF-8</InputEncoding>
</OpenSearchDescription>
+3 −3
Original line number Diff line number Diff line
@@ -51,14 +51,14 @@ def header(charset='utf-8'):
   enc_print('Content-Type: text/xml; charset='+charset)
   enc_print()
   enc_print('<?xml version="1.0" encoding="'+charset+'"?>')
   enc_print('<feed xmlns="http://www.w3.org/2005/Atom" xmlns:opds="http://opds-spec.org/" xmlns:dc="http://purl.org/dc/terms/" xmlns:os="http://a9.com/-/spec/opensearch/1.1/">')
   enc_print('<feed xmlns="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/terms/" xmlns:os="http://a9.com/-/spec/opensearch/1.1/" xmlns:opds="http://opds-spec.org/2010/catalog">')
   enc_print('<id>'+cfg.SITE_ID+'</id>')
   enc_print('<title>'+cfg.SITE_TITLE+'</title>')
   enc_print('<subtitle>Simple OPDS Catalog by www.sopds.ru</subtitle>')
   enc_print('<updated>'+time.strftime("%Y-%m-%dT%H:%M:%SZ")+'</updated>')
   enc_print('<icon>'+cfg.SITE_ICON+'</icon>')
   enc_print('<author><name>'+cfg.SITE_AUTOR+'</name><uri>'+cfg.SITE_URL+'</uri><email>'+cfg.SITE_EMAIL+'</email></author>')
   enc_print('<link type="application/atom+xml;profile=opds-catalog;kind=navigation" rel="start" title="'+cfg.SITE_MAINTITLE+'" href="'+cfg.CGI_PATH+'?id=00"/>')
   enc_print('<link type="application/atom+xml;profile=opds-catalog;kind=navigation" rel="start" href="'+cfg.CGI_PATH+'?id=00"/>')

def footer():
   enc_print('</feed>')
@@ -68,7 +68,7 @@ def main_menu():
   opdsdb.openDB()
   dbinfo=opdsdb.getdbinfo(cfg.DUBLICATES_SHOW)
   enc_print('<link href="'+cfg.SEARCHXML_PATH+'" rel="search" type="application/opensearchdescription+xml" />')
   enc_print('<link href="'+cfg.CGI_PATH+'?search={searchTerms}" rel="search" type="application/atom+xml" />')
   enc_print('<link href="'+cfg.CGI_PATH+'?search={searchTerms}" rel="search" type="application/atom+xml;profile=opds-catalog" />')
   enc_print('<entry>')
   enc_print('<title>По каталогам</title>')
   enc_print('<content type="text">Каталогов: %s, книг: %s.</content>'%(dbinfo[2][0],dbinfo[0][0]))
+1 −1
Original line number Diff line number Diff line
@@ -46,7 +46,7 @@ class cfgreader:

       self.CGI_PATH=config.get_default(CFG_S_GLOBAL,'cgi_path','sopds.cgi')
       self.CGI_PATH=os.path.normpath(self.CGI_PATH)
       self.SEARCHXML_PATH=os.path.join(os.path.dirname(self.CGI_PATH),'opensearch.xml')
       self.SEARCHXML_PATH=os.path.join(os.path.dirname(self.CGI_PATH),'opds-opensearch.xml')

       self.COVER_PATH=config.get_default(CFG_S_GLOBAL,'cover_path','../covers')
       self.COVER_PATH=os.path.normpath(self.COVER_PATH)