Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: missing files in different libraries #3826

Open
Terminal-Grasshopper opened this issue Jan 12, 2025 · 5 comments
Open

[Bug]: missing files in different libraries #3826

Terminal-Grasshopper opened this issue Jan 12, 2025 · 5 comments
Labels
bug Something isn't working unable to reproduce Issue is not yet reproducible waiting Waiting for OP

Comments

@Terminal-Grasshopper
Copy link
Contributor

What happened?

I have libraries

  • Name: All
    Folders: /path/ebooks /path/audiobooks

  • Name: Ebooks

  • Folders: /path/ebooks

  • Name: Audiobooks

  • Folders: /path/audiobooks

The "All" library is missing some audiobooks/ebooks that the niche library (audiobooks/ebooks) does detect and the json file is present

What did you expect to happen?

For items in different libraries that share a folder path, to be showing all the contents of the path

Steps to reproduce the issue

  1. create different libraries that share a common path and add multiple books/audiobooks
  2. i'm not sure of a specific way to reproduce the issue and it could be unnoticed with a huge library

Audiobookshelf version

v2.17.7

How are you running audiobookshelf?

Docker

What OS is your Audiobookshelf server hosted from?

Linux

If the issue is being seen in the UI, what browsers are you seeing the problem on?

None

Logs

2025-01-12 19:31:50.540

DEBUG

[Watcher] Rename /files/E-Books/Security Risk Management Building an Information Security Risk Management Program from the Ground Up by Evan Wheeler/metadata.json => /files/E-Books/Security Risk Management Building an Information Security Risk Management Program from the Ground Up/metadata.json

2025-01-12 19:32:00.576

DEBUG

[Scanner] scanFolderUpdates fileUpdateGroup { 'New folder': [ 'Security Risk Management Building an Information Security Risk Management Program from the Ground Up.pdf', 'cover.jpg' ], 'Security Risk Management Building an Information Security Risk Management Program from the Ground Up': [ 'Security Risk Management Building an Information Security Risk Management Program from the Ground Up.pdf', 'cover.jpg', 'Thumbs.db', 'metadata.json' ] }

2025-01-12 19:32:00.582

ERROR

[Utils] Failed to get ino for path /files/E-Books/New folder/Security Risk Management Building an Information Security Risk Management Program from the Ground Up.pdf [Error: ENOENT: no such file or directory, stat '/files/E-Books/New folder/Security Risk Management Building an Information Security Risk Management Program from the Ground Up.pdf'] { errno: -2, code: 'ENOENT', syscall: 'stat', path: '/files/E-Books/New folder/Security Risk Management Building an Information Security Risk Management Program from the Ground Up.pdf' }

2025-01-12 19:32:00.681

DEBUG

[LibraryScanner] Folder update group must be a new item "Security Risk Management Building an Information Security Risk Management Program from the Ground Up" in library "E-Books"

2025-01-12 19:32:00.682

DEBUG

[Scan] "Security Risk Management Building an Information Security Risk Management Program from the Ground Up": "Security Risk Management Building an Information Security Risk Management Program from the Ground Up" Getting metadata with precedence [folderStructure, audioMetatags, nfoFile, txtFiles, opfFile, absMetadata]

2025-01-12 19:32:00.682

DEBUG

[Scan] "Security Risk Management Building an Information Security Risk Management Program from the Ground Up": Found metadata file "/files/E-Books/Security Risk Management Building an Information Security Risk Management Program from the Ground Up/metadata.json"

Additional Notes

rescanning, matching, or creating a new folder for the item doesn't fix the issue (sometimes creating another folder fixes it but not always)

@Terminal-Grasshopper Terminal-Grasshopper added the bug Something isn't working label Jan 12, 2025
@advplyr
Copy link
Owner

advplyr commented Jan 12, 2025

If you do a manual scan of the library does it pull in those items?

@advplyr advplyr added waiting Waiting for OP unable to reproduce Issue is not yet reproducible labels Jan 12, 2025
@Terminal-Grasshopper
Copy link
Contributor Author

i just tried a manual scan again and many of those missing were detected 👍

@advplyr
Copy link
Owner

advplyr commented Jan 12, 2025

I recommend disabling the folder watcher and using scheduled scans that are staggered in time if you are using the same paths for multiple libraries. I didn't design the scanner for this use-case and hadn't considered it.

If the watcher detects an update to a file it "locks" the file from being scanned again, so the first library's folder watcher that detects the change is going to be the one that gets it.

It's unlikely that the scanner gets re-designed to support this so we might consider adding some warning in the library modal.

I'm not sure what your actual issue is though because running a manual scan on the library should be no problem as long as the other library with the same folder path isn't also scanning it. I was just testing having multiple libraries with the same folder path a few days ago and it works so long as the library scans don't overlap eachother.

@Terminal-Grasshopper
Copy link
Contributor Author

Terminal-Grasshopper commented Jan 12, 2025

yes something like a warning to inform the user about this would solve the issue for now in order to minimize the impact and keep the user informed, previously when i ran the manual scan multiple times and i didn't see any new books and it's taking long therefore cancelled the task thinking this won't fix it

now 1,000 items got added to my "All" library

to fix this the database should be adjusted to take into account each file is in which folder, and each folder is assigned to which librar(ies)

so if a file is detected by the watcher or the scanner, the folder is taken into account then query which library also has this folder path. as an extra measure it would need to look at the whole path since:
library 1 access:
path/audiobooks/fiction/

library 2 access:
path/audiobooks/

therefore if a file is detected in library 1 then it should also be added to library 2

@advplyr
Copy link
Owner

advplyr commented Jan 13, 2025

It is not planned to update the scanner to support multiple libraries pointing to the same folders. But we can leave this issue open for adding a warning message.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working unable to reproduce Issue is not yet reproducible waiting Waiting for OP
Projects
None yet
Development

No branches or pull requests

2 participants