crocodilestick / Calibre-Web-Automated

Calibre-Web but automated and with Calibre features! Fully automate and simplify your eBook set up!
https://github.com/crocodilestick/Calibre-Web-Automator
GNU General Public License v3.0
548 stars 11 forks source link

[bug] cover-enforcer -all throws up an error #94

Open dushyantahuja opened 18 hours ago

dushyantahuja commented 18 hours ago

Describe the bug cover-enforcer -all throws up the following error:

[cover-enforcer]: Connection with the CWA Enforcement DB Successful!
[cover-enforcer]: Enforcing metadata and covers for all books in library...
[cover-enforcer]: 3424 books detected in Library
[cover-enforcer]: Enforcing covers for 3424 epub file(s) in /calibre-library ...
Traceback (most recent call last):
  File "/app/calibre-web-automated/scripts/cover-enforcer.py", line 213, in <module>
    main()
  File "/app/calibre-web-automated/scripts/cover-enforcer.py", line 183, in main
    n_enforced, completion_time = enforcer.enforce_all_covers()
  File "/app/calibre-web-automated/scripts/cover-enforcer.py", line 104, in enforce_all_covers
    book_info = self.enforce_cover(book_dir)
  File "/app/calibre-web-automated/scripts/cover-enforcer.py", line 76, in enforce_cover
    book_id: str = (list(re.findall(r'\(\d*\)', book_dir))[-1])[1:-1]
IndexError: list index out of range

To Reproduce Steps to reproduce the behavior:

  1. Run cover-enforcer -all
  2. This is on the latest docker version - I have ebooks with multiple versions - many epubs and mobis

Expected behavior The covers should be enforced on all the epubs. The script should ignore other versions of the ebooks.

Screenshots Screenshot 2024-09-23 at 6 34 40 AM

Configuration(please complete the following information):

crocodilestick commented 5 hours ago

Hi @dushyantahuja , could you use tree on an author's directory in your calibre library so I can check it's file & naming structure?

dushyantahuja commented 4 hours ago
Wolke, Robert/
└── What Einstein Told His Barber_ More Scientific Answers to Everyday Questions (4411)
    ├── cover.jpg
    ├── metadata.opf
    └── What Einstein Told His Barber_ More Scientific Answers to Everyday Questions - Wolke, Robert.epub

2 directories, 3 files
dushyantahuja commented 4 hours ago
Terry Goodkind/
└── Wizard's First Rule (6120)
    ├── cover.jpg
    ├── metadata.opf
    ├── Wizard's First Rule - Terry Goodkind.epub
    └── Wizard's First Rule - Terry Goodkind.mobi

2 directories, 4 files