readium / r2-streamer-js

NodeJS Readium2 "streamer"
BSD 3-Clause "New" or "Revised" License
21 stars 10 forks source link

Publications in OPDS2 feed always empty #57

Closed rishighan closed 3 years ago

rishighan commented 3 years ago

This is how I instantiate the readium server:

import {
    Server
} from "r2-streamer-js";

const OPDSServer = new Server({
    disableDecryption: false, // deactivates the decryption of encrypted resources (Readium LCP).
    disableOPDS: false, // deactivates the HTTP routes for the OPDS "micro services" (browser, converter)
    disableReaders: false, // deactivates the built-in "readers" for ReadiumWebPubManifest (HTTP static host / route).
    disableRemotePubUrl: false, // deactivates the HTTP route for loading a remote publication.
    maxPrefetchLinks: 5, // Link HTTP header, with rel = prefetch, see server.ts MAX_PREFETCH_LINKS (default = 10)
});

const url = async () => await OPDSServer.start(5643, false);
url().then(async (res) => {
    console.log(res);
    const publicationURLs = OPDSServer.addPublications([
        "http://localhost:3000/comics/Iron Man/Iron Man - V1 193.cbz",
    ]);
    console.log(publicationURLs);
    OPDSServer.publicationsOPDS();

    const publication = await OPDSServer.loadOrGetCachedPublication(
        "http://localhost:3000/comics/Iron Man/Iron Man - V1 193.cbz",
    );
    console.log(publication);
    OPDSServer.publicationsOPDS();
});

When I look at the OPDS2 feed located here http://localhost:5643/opds2/publications.json/show, I get this response:

{
    "metadata": {
        "numberOfItems": 0,
        "@type": "http://schema.org/DataFeed",
        "title": "Readium 2 OPDS 2.0 Feed",
        "modified": "Wed Jul 14 2021 09:43:52 GMT-0700 (Pacific Daylight Time)"
    },
    "links": [
        {
            "type": "application/opds+json",
            "rel": "self",
            "href": "http://localhost:5643/opds2/publications.json"
        }
    ],
    "publications": [ ]
}

Why isn't my comic listed in the publications list?

danielweck commented 3 years ago

Sorry, this "streamer" usage is not supported. See https://github.com/readium/r2-streamer-js/issues/58