Работа над opds

This commit is contained in:
Book Pauk
2022-11-24 19:08:34 +07:00
parent 72ab94291c
commit 870f95a51f
4 changed files with 65 additions and 7 deletions

View File

@@ -89,11 +89,21 @@ class BasePage {
});
}
baseLinks(req) {
return [
baseLinks(req, selfAcq = false) {
const result = [
this.makeLink({href: `${this.opdsRoot}/opensearch`, rel: 'search', type: 'application/opensearchdescription+xml'}),
this.makeLink({href: `${this.opdsRoot}/search?term={searchTerms}`, rel: 'search', type: 'application/atom+xml'}),
this.navLink({rel: 'start'}),
this.navLink({rel: 'self', href: req.originalUrl, hrefAsIs: true}),
];
if (selfAcq) {
result.push(this.acqLink({rel: 'self', href: req.originalUrl, hrefAsIs: true}));
} else {
result.push(this.navLink({rel: 'self', href: req.originalUrl, hrefAsIs: true}));
}
return result;
}
makeBody(content, req) {