[Bug]: ABS does not add ebooks to its libraries in folders with metadata.opf files created by Calibre #1388

Closed
opened 2026-04-24 23:43:41 +02:00 by adam · 7 comments
Owner

Originally created by @iconoclasthero on GitHub (Sep 17, 2023).

Describe the issue

Ubuntu 22.04, ABS 4.2.2, calibre 6.12
ABS does not add ebooks to its libraries in folders with metadata.opf files created by Calibre. E.g., in my ebook libarary which is in the default calibre format: /library/ebooks/author/book/ebook.@(mobi|pdf|awz3|epub). In that terminal directory, calibre adds a metadata.opf file. I pointed ABS at that library and I only the last few books that I added (i.e., that hadn't been input into Calibre yet) showed up in ABS. I deleted the library (after adding the few stragglers above to calibre) and recreated the ebook library. 0% of the books were added. I went to one book and $ mv metadata.opf and the book appeared. This was observed with a second book.

I don't know why abs is inhibited from adding books with the metadata.opf and I get that having two different applications managing the same library can cause issues...but I still want the books added to ABS.

Steps to reproduce the issue

  1. Install calibre and have it manage your ebooks
  2. point abs at the ebook folders managed by calibre that have calibre's metadata.opf files in them
  3. see that abs doesn't add books
  4. remove metadata.opf file from ebook dir
  5. see abs add book

Audiobookshelf version

4.2.2

How are you running audiobookshelf?

Debian/PPA

Originally created by @iconoclasthero on GitHub (Sep 17, 2023). ### Describe the issue Ubuntu 22.04, ABS 4.2.2, calibre 6.12 ABS does not add ebooks to its libraries in folders with metadata.opf files created by Calibre. E.g., in my ebook libarary which is in the default calibre format: /library/ebooks/author/book/ebook.@(mobi|pdf|awz3|epub). In that terminal directory, calibre adds a metadata.opf file. I pointed ABS at that library and I only the last few books that I added (i.e., that hadn't been input into Calibre yet) showed up in ABS. I deleted the library (after adding the few stragglers above to calibre) and recreated the ebook library. 0% of the books were added. I went to one book and `$ mv metadata.opf ` and the book appeared. This was observed with a second book. I don't know why abs is inhibited from adding books with the metadata.opf and I get that having two different applications managing the same library can cause issues...but I still want the books added to ABS. ### Steps to reproduce the issue 1. Install calibre and have it manage your ebooks 2. point abs at the ebook folders managed by calibre that have calibre's metadata.opf files in them 3. see that abs doesn't add books 4. remove metadata.opf file from ebook dir 5. see abs add book ### Audiobookshelf version 4.2.2 ### How are you running audiobookshelf? Debian/PPA
adam added the bug label 2026-04-24 23:43:41 +02:00
adam closed this issue 2026-04-24 23:43:41 +02:00
Author
Owner

@advplyr commented on GitHub (Sep 17, 2023):

I just tested this with a calibre folder and every book was detected. The metadata.opf should not have anything to do with the scanner issue you are having. Abs will use a lot of the data from the opf file.

It's possible that the reason removing the metadata.opf added the book is because the scanner detected a change in that folder and rescanned the folder. If that is the case then removing or adding any file would have caused the re-scan.

You will need to provide more information or narrow down the steps of reproducing this

@advplyr commented on GitHub (Sep 17, 2023): I just tested this with a calibre folder and every book was detected. The metadata.opf should not have anything to do with the scanner issue you are having. Abs will use a lot of the data from the opf file. It's possible that the reason removing the metadata.opf added the book is because the scanner detected a change in that folder and rescanned the folder. If that is the case then removing or adding any file would have caused the re-scan. You will need to provide more information or narrow down the steps of reproducing this
Author
Owner

@iconoclasthero commented on GitHub (Sep 17, 2023):

Like I said, I tried to touch each and every single file/folder in that directory and it did not work.
I did a $ find * -iname "metadata.opf" -exec mv {} {}\~ \;
and now it populates all the books. I'll go back and use find to undo that later so that calibre has it's metadata.opf files again.

Did you have a calibre library that existed before you pointed abs at it?

@iconoclasthero commented on GitHub (Sep 17, 2023): Like I said, I tried to touch each and every single file/folder in that directory and it did not work. I did a `$ find * -iname "metadata.opf" -exec mv {} {}\~ \;` and now it populates all the books. I'll go back and use find to undo that later so that calibre has it's metadata.opf files again. Did you have a calibre library that existed _before_ you pointed abs at it?
Author
Owner

@advplyr commented on GitHub (Sep 17, 2023):

Yes, but I also tested adding a new book through calibre and Abs automatically scanned it in correctly

@advplyr commented on GitHub (Sep 17, 2023): Yes, but I also tested adding a new book through calibre and Abs automatically scanned it in correctly
Author
Owner

@iconoclasthero commented on GitHub (Sep 17, 2023):

Well, it's done scanning and now I have 565 books. All I did was the above find ... -exec ... command and the rescanned it.

I am sure that it isn't a matter of how recently the files/folders were modified since I did something like $ find * -iname "*" -exec touch {} \; . Besides, I told it to scan the folder and it only found things without metadata.opf files with the ebooks. The age of the folders don't matter for any other books (which are all audiobooks without the metadata.opf files).

@iconoclasthero commented on GitHub (Sep 17, 2023): Well, it's done scanning and now I have 565 books. All I did was the above find ... -exec ... command and the rescanned it. I am sure that it isn't a matter of how recently the files/folders were modified since I did something like `$ find * -iname "*" -exec touch {} \; `. Besides, I told it to scan the folder and it only found things without metadata.opf files with the ebooks. The age of the folders don't matter for any other books (which are all audiobooks without the metadata.opf files).
Author
Owner

@iconoclasthero commented on GitHub (Sep 17, 2023):

Maybe it wasn't done... Not sure what it is doing, but it's now up to ca. 1000 books and as I recall, I have ca. 3000.

@iconoclasthero commented on GitHub (Sep 17, 2023): Maybe it wasn't done... Not sure what it is doing, but it's now up to ca. 1000 books and as I recall, I have ca. 3000.
Author
Owner

@iconoclasthero commented on GitHub (Sep 18, 2023):

Ok, I assume that ABS is done doing what it's going to do with this collection. According to ABS I have [exactly] 1600 books while calibre reports 1618 books. There are absolutely copies of the same book in more than one format. An average of 2 different formats for every book seems a bit high, but let's assume that is the case anyway (since figuring that out appears to be a herculean task). Otherwise it is hard to explain the results of GNU find:

/library/epubs $ find . \( -iname *pdf -o -iname *azw3 -o -iname *epub -o -iname *mobi \)|wc -l
2987

I have gone back and moved metadata.opf~ to metadata.opf.

@iconoclasthero commented on GitHub (Sep 18, 2023): Ok, I assume that ABS is done doing what it's going to do with this collection. According to ABS I have [exactly] 1600 books while calibre reports 1618 books. There are absolutely copies of the same book in more than one format. An average of 2 different formats for every book seems a bit high, but let's assume that is the case anyway (since figuring that out appears to be a herculean task). Otherwise it is hard to explain the results of GNU find: ``` /library/epubs $ find . \( -iname *pdf -o -iname *azw3 -o -iname *epub -o -iname *mobi \)|wc -l 2987 ``` I have gone back and moved metadata.opf~ to metadata.opf.
Author
Owner

@advplyr commented on GitHub (Sep 21, 2023):

I'm not sure what there is to do here so I'm going to close this out

@advplyr commented on GitHub (Sep 21, 2023): I'm not sure what there is to do here so I'm going to close this out
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/audiobookshelf#1388