Commit 0287ed61 authored by mitshel's avatar mitshel
Browse files

В sopdscfg.py добавлено формирование полного пути к opensearch.xml на основе пути к sopds.cgi

В заголовок xml-файла добавлены аттрибуты xmlns:dc="http://purl.org/dc/terms/" xmlns:os="http://a9.com/-/spec/opensearch/1.1/"
Без них например в FBREader не работал поиск
parent d0b6c5e2
Loading
Loading
Loading
Loading

py/opds-opensearch.xml

0 → 100644
+17 −0
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 −2
Original line number Diff line number Diff line
@@ -2,8 +2,9 @@
<OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/">
  <ShortName>SimpleOPDS</ShortName>
  <LongName>SimpleOPDS</LongName>
  <Url type="application/atom+xml" template="sopds.cgi?search={searchTerms}" />
  <Image width="16" height="16">/favicon.ico</Image>
  <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 />
+2 −2
Original line number Diff line number Diff line
@@ -51,7 +51,7 @@ 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/">')
   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('<id>'+cfg.SITE_ID+'</id>')
   enc_print('<title>'+cfg.SITE_TITLE+'</title>')
   enc_print('<subtitle>Simple OPDS Catalog by www.sopds.ru</subtitle>')
@@ -67,7 +67,7 @@ def main_menu():
   opdsdb=sopdsdb.opdsDatabase(cfg.DB_NAME,cfg.DB_USER,cfg.DB_PASS,cfg.DB_HOST,cfg.ROOT_LIB)
   opdsdb.openDB()
   dbinfo=opdsdb.getdbinfo(cfg.DUBLICATES_SHOW)
   enc_print('<link href="opensearch.xml" rel="search" type="application/opensearchdescription+xml" />')
   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('<entry>')
   enc_print('<title>По каталогам</title>')
+1 −0
Original line number Diff line number Diff line
@@ -46,6 +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.COVER_PATH=config.get_default(CFG_S_GLOBAL,'cover_path','../covers')
       self.COVER_PATH=os.path.normpath(self.COVER_PATH)