OPDS id are cleanly handled. re #40

This commit is contained in:
Sébastien Lucas 2013-04-30 09:11:04 +02:00
parent ad52901226
commit 526483d7a5
2 changed files with 6 additions and 2 deletions

View file

@ -92,7 +92,9 @@ class OPDSRenderer
self::getXmlStream ()->startElement ("id"); self::getXmlStream ()->startElement ("id");
if ($page->idPage) if ($page->idPage)
{ {
self::getXmlStream ()->text ($page->idPage); $idPage = $page->idPage;
if (!is_null (GetUrlParam (DB))) $idPage = GetUrlParam (DB) . ":" . $idPage;
self::getXmlStream ()->text ($idPage);
} }
else else
{ {

View file

@ -267,6 +267,8 @@ class Entry
} }
} }
} }
if (!is_null (GetUrlParam (DB))) $this->id = GetUrlParam (DB) . ":" . $this->id;
} }
} }
@ -367,7 +369,7 @@ class Page
if (is_array ($config['calibre_directory']) && is_null ($database)) { if (is_array ($config['calibre_directory']) && is_null ($database)) {
$i = 0; $i = 0;
foreach ($config['calibre_directory'] as $key => $value) { foreach ($config['calibre_directory'] as $key => $value) {
array_push ($this->entryArray, new Entry ($key, DB . ":{$i}", array_push ($this->entryArray, new Entry ($key, "{$i}:cops:catalog",
"", "text", "", "text",
array ( new LinkNavigation ("?" . DB . "={$i}")))); array ( new LinkNavigation ("?" . DB . "={$i}"))));
$i++; $i++;