advplyr / audiobookshelf

Self-hosted audiobook and podcast server
https://audiobookshelf.org
GNU General Public License v3.0
6.66k stars 472 forks source link

[Bug]: Doing a scan of Library some books are being recharacterized as other books #1387

Closed ceramicwhite closed 1 year ago

ceramicwhite commented 1 year ago

Describe the issue

Manually scanning library some of my titles are being listed as the path has changed to location of other titles:

2023-01-10 12:20:40 [2023-01-10 12:20:40] WARN: [LibraryItem] Check scan item changed path "/library/Anthony Horowitz/James Bond/Book 0 - Forever and a Day" -> "/library/Jocko Willink/Extreme Ownership" (LibraryItem.js:344)
2023-01-10 12:20:40 [2023-01-10 12:20:40] WARN: [LibraryItem] Check scan item changed path "/library/Anthony Horowitz/James Bond/Book 45 - Trigger Mortis" -> "/library/John E. Douglas, Mark Olshaker/Mindhunter" (LibraryItem.js:344
;ABMETADATA2
#audiobookshelf v2.2.12

media=book
title=Trigger Mortis
subtitle=A James Bond Novel
authors=Anthony Horowitz
narrators=David Oyelowo
publishedYear=2015
publisher=Orion Publishing Group
isbn=
asin=B00YTB0ONE
language=English
genres=Mystery, Thriller & Suspense
series=James Bond #45
explicit=N
;ABMETADATA2
#audiobookshelf v2.2.12

media=book
title=Forever and a Day
subtitle=A James Bond Novel
authors=Anthony Horowitz
narrators=Matthew Goode
publishedYear=2018
publisher=HarperAudio
isbn=
asin=B07DWBLKH3
language=English
genres=Literature & Fiction, Mystery, Thriller & Suspense
series=James Bond #0
explicit=N
;ABMETADATA2
#audiobookshelf v2.2.12

media=book
title=Extreme Ownership
subtitle=How U.S. Navy SEALs Lead and Win
authors=Jocko Willink, Leif Babin
narrators=Jocko Willink, Leif Babin
publishedYear=2015
publisher=Macmillan Audio
isbn=
asin=B015TVHUA2
language=English
genres=Business & Careers, History
series=
explicit=N
;ABMETADATA2
#audiobookshelf v2.2.12

media=book
title=Trigger Mortis
subtitle=A James Bond Novel
authors=Anthony Horowitz
narrators=David Oyelowo
publishedYear=2015
publisher=Orion Publishing Group
isbn=
asin=B00YTB0ONE
language=English
genres=Mystery, Thriller & Suspense
series=James Bond #45
explicit=N

Extreme Ownership & Mindhunter are then listed as missing

If I then check the full path to files for the Bond books the paths are listed correctly in ABS: /library/Anthony Horowitz/James Bond/Book 0 - Forever and a Day/Book 0 - Forever and a Day.m4b

Steps to reproduce the issue

  1. Do a normal library scan from Settings--> Library

Audiobookshelf version

v2.2.12

How are you running audiobookshelf?

Docker

advplyr commented 1 year ago

Are you able to consistently reproduce this? I wasn't able to just now in testing.

ceramicwhite commented 1 year ago

@advplyr Yeah, I think the problem is if mounting a second library outside of /audiobooks. For example mounting like this:

    volumes:
      - ./audiobooks:/audiobooks
      - ./audiobooks-backup:/library

When I switched back to:

    volumes:
      - ./audiobooks:/audiobooks/main
      - ./audiobooks-backup:/audiobooks/backup

It seems to be working as expected

advplyr commented 1 year ago

Can you check if you have this log right before the logs you shared on changing paths: [Scanner] scanFolderUpdates: Library item found by inode value "${existingLibraryItem.relPath} => ${itemDir}"

Hopefully you had debug logs turned on.

ceramicwhite commented 1 year ago

@advplyr Debug on can't see that line anywhere:

2023-01-12 11:30:18 > audiobookshelf@2.2.12 start
2023-01-12 11:30:18 > node index.js
2023-01-12 11:30:18 
2023-01-12 11:30:19 Config /config /metadata
2023-01-12 11:30:19 [2023-01-12 11:30:19] INFO: === Starting Server ===
2023-01-12 11:30:19 [2023-01-12 11:30:19] INFO: [Server] Init v2.2.12
2023-01-12 11:30:19 [2023-01-12 11:30:19] INFO: [DB] 0 Collections Loaded
2023-01-12 11:30:19 [2023-01-12 11:30:19] INFO: [DB] 0 Playlists Loaded
2023-01-12 11:30:19 [2023-01-12 11:30:19] DEBUG: Set Log Level to DEBUG (Logger.js:86)
2023-01-12 11:30:19 [2023-01-12 11:30:19] INFO: [DB] 1 Libraries Loaded
2023-01-12 11:30:19 [2023-01-12 11:30:19] INFO: [DB] 1 Users Loaded
2023-01-12 11:30:19 [2023-01-12 11:30:19] INFO: [DB] 169 Authors Loaded
2023-01-12 11:30:19 [2023-01-12 11:30:19] INFO: [DB] 25 Series Loaded
2023-01-12 11:30:19 [2023-01-12 11:30:19] INFO: [DB] 542 Library Items Loaded
2023-01-12 11:30:19 [2023-01-12 11:30:19] INFO: [BackupManager] 0 Backups Found
2023-01-12 11:30:19 [2023-01-12 11:30:19] INFO: [BackupManager] Auto Backups are disabled
2023-01-12 11:30:19 [2023-01-12 11:30:19] DEBUG: Daily Log file found 2023-01-07.txt (LogManager.js:85)
2023-01-12 11:30:19 [2023-01-12 11:30:19] DEBUG: Daily Log file found 2023-01-08.txt (LogManager.js:85)
2023-01-12 11:30:19 [2023-01-12 11:30:19] DEBUG: Daily Log file found 2023-01-09.txt (LogManager.js:85)
2023-01-12 11:30:19 [2023-01-12 11:30:19] DEBUG: Daily Log file found 2023-01-10.txt (LogManager.js:85)
2023-01-12 11:30:19 [2023-01-12 11:30:19] DEBUG: Daily Log file found 2023-01-11.txt (LogManager.js:85)
2023-01-12 11:30:19 [2023-01-12 11:30:19] INFO: [LogManager] Init current daily log filename: 2023-01-12.txt
2023-01-12 11:30:19 [2023-01-12 11:30:19] INFO: [Watcher] Initializing watcher for "remote".
2023-01-12 11:30:19 [2023-01-12 11:30:19] DEBUG: [Watcher] Init watcher for library folder path "/remote" (Watcher.js:34)
2023-01-12 11:30:19 [2023-01-12 11:30:19] INFO: Listening on port :80
2023-01-12 11:30:32 [2023-01-12 11:30:32] INFO: [Watcher] "remote" Ready
2023-01-12 11:30:32 [2023-01-12 11:30:32] INFO: [Server] Socket Connected DkuAvYdnimekl7dzAAAB
2023-01-12 11:30:32 [2023-01-12 11:30:32] DEBUG: [Server] User Online root (SocketAuthority.js:161)
2023-01-12 11:30:32 [2023-01-12 11:30:32] DEBUG: [DB] Updated user: 1 (Db.js:382)
2023-01-12 11:30:44 [2023-01-12 11:30:44] INFO: [Scanner] Starting library scan lscan_x943pj353pt7ekz3w7 for remote
2023-01-12 11:32:12 [2023-01-12 11:32:12] WARN: [LibraryItem] Check scan item changed path "/remote/Star Wars non-cannon/13 - Omen (Fate of the Jedi Book 2) (43.5 ABY)" -> "/remote/Stephen King/2009 - Under the Dome (read by Raul Esparza)" (LibraryItem.js:344)
2023-01-12 11:32:12 [2023-01-12 11:32:12] DEBUG: [LibraryItem] "Fate of the Jedi, Book 2: Omen" check scan cover removed (LibraryItem.js:379)
2023-01-12 11:32:12 [2023-01-12 11:32:12] WARN: [LibraryItem] Check scan item changed path "/remote/Star Wars non-cannon/12 - Dark Force Rising[The Thrawn Trilogy Book 2] (9 ABY)" -> "/remote/Stephen King/2008 - Duma Key (read by John Slattery)" (LibraryItem.js:344)
2023-01-12 11:32:12 [2023-01-12 11:32:12] DEBUG: [LibraryItem] "Star Wars: Dark Force Rising: The Thrawn Trilogy, Book 2" check scan cover removed (LibraryItem.js:379)
2023-01-12 11:32:12 [2023-01-12 11:32:12] WARN: [LibraryItem] Check scan item changed path "/remote/Star Wars non-cannon/10 - Shatterpoint (21.5 BBY)" -> "/remote/Stephen King/2002 - Everything's Eventual (14 short stories)" (LibraryItem.js:344)
2023-01-12 11:32:12 [2023-01-12 11:32:12] DEBUG: [LibraryItem] "Shatterpoint" check scan cover removed (LibraryItem.js:379)
2023-01-12 11:32:12 [2023-01-12 11:32:12] WARN: [LibraryItem] Check scan item changed path "/remote/Star Wars non-cannon/09 - Invincible (Legacy Of The Force Book 9) (40 ABY)" -> "/remote/Stephen King/1999 - Storm of the Century" (LibraryItem.js:344)
2023-01-12 11:32:12 [2023-01-12 11:32:12] DEBUG: [LibraryItem] "Legacy of the Force #9: Invincible" check scan cover removed (LibraryItem.js:379)
2023-01-12 11:32:12 [2023-01-12 11:32:12] WARN: [LibraryItem] Check scan item changed path "/remote/Star Wars non-cannon/08 - Solo Command[X-Wing Book 7] (7.5 ABY)" -> "/remote/Stephen King/1996 - The Regulators (read by Frank Muller)" (LibraryItem.js:344)
2023-01-12 11:32:12 [2023-01-12 11:32:12] DEBUG: [LibraryItem] "Star Wars: The X-Wing Series, Volume 7: Solo Command" check scan cover removed (LibraryItem.js:379)

2023-01-12.txt 2023-01-12_lscan_0wu5nvjjbvnbzacmlm.txt

Doing a rescan doesn't do anything but the books who's paths are being listed as a different titles, if I do individual rescans on those titles from the missing list they are then fixed. Also the books that paths are listed as change to another title if I check files full path they are still the correct pathing

advplyr commented 1 year ago

I just realized this is the same as #1447 so I'll make that the primary.

I added the actual inode value to that log line in the most recent release as mentioned in #1447.

advplyr commented 1 year ago

Nevermind, just read through this thread again and was mistaken. I'm not sure what is going on here.

ceramicwhite commented 1 year ago

@advplyr after reading through #1447 that's a common issue I have and may be connected. In actuality wrong covers showing on other titles is a persistent issue I've had for awhile, this one hasn't occurred in a couple weeks.

advplyr commented 1 year ago

Ah okay then it is most likely the same issue then. We will use that thread as the main thread.

In the last release I updated the log line so it will print the inode value. I'm wondering what the inode value is for these folders because they are somehow the same value causing the overwrite.

waiting for an answer on that in #1447