mikespub-org / seblucas-cops

Calibre OPDS (and HTML) PHP Server : web-based light alternative to Calibre content server / Calibre2OPDS to serve ebooks (epub, mobi, pdf, ...)
http://blog.slucas.fr/en/oss/calibre-opds-php-server
GNU General Public License v2.0
55 stars 7 forks source link

Error sending or reading book from additional dbs #72

Closed malkavi closed 4 months ago

malkavi commented 6 months ago

Hi, I'm trying to send books from others dbs differents to 0 and I can't. Reading a little bit the code I see that epubreader.php only read data param from url and not the db param needed for identify the correct db. If I try to send a book from db different to 0 I received a book from db=0. URL example: https://copsurl/epubreader.php?data=7852&db=2

Code used to read the book (EPubReader.php). The db param is readed from the book data not from a param.

  public static function getReader($idData, $request)
    {
        $book = Book::getBookByDataId($idData);
        $params = ['data' => $idData, 'db' => $book->getDatabaseId()];

Sorry If I am not enough clear or I am missing information.

Thanks for the hard work!

mikespub commented 4 months ago

You're absolutely right - I did miss sending the right database information when I split off the EpubReader and Mail classes. Fixed in the latest release