Comment 2 for bug 1992244

Revision history for this message
Florian Bach (leseratte10) wrote :

Thanks for the bugfix, but the behaviour is still broken now, just in a different way. Unfortunately I was unable to test that before the new version was released today, I tried to compile Calibre myself on Linux but was unsuccessful.

It seems as if Calibre is now running the FileTypePlugins twice, or even three times sometimes.

Looking at the log file, Calibre first executes the ACSM Input plugin as intended, turning the ACSM file into an EPUB file. But then, after that, Calibre is trying to run the ACSM FileTypePlugin again, using a nonexistant file:

"ACSM Input v0.1.0: Trying to parse file mnqfpahl_import_plugin.acsm"
"ACSM Input v0.1.0: Hey, that didn't work: ACSM not found or invalid"

After that, the book is still added to the Calibre book database, but Calibre thinks it's an ACSM file. It displays "Formats: ACSM" in the sidebar and refuses to open it. If I open the path the file is in, the file is named with the correct Title and Author, but with the extension "acsm" instead of "epub". If I rename that file to "epub" I get a valid EPUB file with DRM.

I'm hoping my explaination of the error was clear, the issue seems to be a bit tricky. The errors do not occur when adding the ACSM through the Calibre GUI or through the auto-add code, just through the WebUI.

If necessary I can post exact instructions on how you can reproduce the bug yourself, just let me know what you need. Here's a quote from the debug log, showing that the plugin runs multiple times instead of once:

```
ACSM Input v0.1.0: Trying to parse file URLLink - 2022-10-14T124313.013.acsm
ACSM Input v0.1.0: Try to fulfill ...
... (tons of debug logs from my plugin removed)
ACSM Input v0.1.0: Downloading book ...
ACSM Input v0.1.0: Loading book from http://contentserver.adobe.com/media/xxxx.epub
Download took 1676 ms (HTTP 200)
That's a ZIP file -> EPUB
ACSM Input v0.1.0: File successfully fulfilled ...
ACSM Input v0.1.0: Trying to parse file URLLink - 2022-10-14T124313.013.acsm
ACSM Input v0.1.0: Try to fulfill ...

ACSM Input v0.1.0: Downloading book ...
ACSM Input v0.1.0: Loading book from http://contentserver.adobe.com/media/xxxx.epub
Download took 1824 ms (HTTP 200)
That's a ZIP file -> EPUB
ACSM Input v0.1.0: File successfully fulfilled ...
ACSM Input v0.1.0: Trying to parse file ujix2pdn_import_plugin.acsm
ACSM Input v0.1.0: Try to fulfill ...
ACSM Input v0.1.0: Hey, that didn't work:
ACSM not found or invalid
Received server change event: BooksAdded(book_ids=3065) for /media/some/path/that/i/censored
```