[PR #4249] [MERGED] Update watcher to re-scan library items for non-media file only updates #4197

Closed
opened 2026-04-25 00:18:44 +02:00 by adam · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/advplyr/audiobookshelf/pull/4249
Author: @advplyr
Created: 5/2/2025
Status: Merged
Merged: 5/2/2025
Merged by: @advplyr

Base: masterHead: watcher_rescans_update


📝 Commits (1)

  • 2cc9d1b Update watcher to re-scan library items when non-media files are added/updated #4245

📊 Changes

3 files changed (+17 additions, -8 deletions)

View changed files

📝 server/models/LibraryItem.js (+0 -1)
📝 server/scanner/LibraryScanner.js (+1 -1)
📝 server/utils/scandir.js (+16 -6)

📄 Description

Brief summary

This update improves the watcher to support, for example, adding a cover image to an existing library item folder and triggering a re-scan for that item.

Which issue is fixed?

Fixes #4245

In-depth Description

When the watcher detects files added/removed in a library folder it groups the files into potential library item paths. That grouping process distinguishes between media files and other files for the purpose of ignoring folders that only have non-media files. Other files are included in the grouping only if there is a media file in that potential library item group.

Note: These groups are "potential" library items because at that stage it is not confirmed whether those paths are existing library items.

This update changes that to allow for "scannable" non-media files (e.g. txt, nfo, png, json) to be included in the library item grouping even if it is the only file.

How have you tested this?

  1. Create a new folder with a single audio file and ensure it is added to the library with no cover image.
  2. Add a cover image to the folder
  3. Observe the watcher is triggered and the cover image is applied to the library item

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/advplyr/audiobookshelf/pull/4249 **Author:** [@advplyr](https://github.com/advplyr) **Created:** 5/2/2025 **Status:** ✅ Merged **Merged:** 5/2/2025 **Merged by:** [@advplyr](https://github.com/advplyr) **Base:** `master` ← **Head:** `watcher_rescans_update` --- ### 📝 Commits (1) - [`2cc9d1b`](https://github.com/advplyr/audiobookshelf/commit/2cc9d1b7f8f42fa3f8965343851b7c673060555e) Update watcher to re-scan library items when non-media files are added/updated #4245 ### 📊 Changes **3 files changed** (+17 additions, -8 deletions) <details> <summary>View changed files</summary> 📝 `server/models/LibraryItem.js` (+0 -1) 📝 `server/scanner/LibraryScanner.js` (+1 -1) 📝 `server/utils/scandir.js` (+16 -6) </details> ### 📄 Description <!-- For Work In Progress Pull Requests, please use the Draft PR feature, see https://github.blog/2019-02-14-introducing-draft-pull-requests/ for further details. If you do not follow this template, the PR may be closed without review. Please ensure all checks pass. If you are a new contributor, the workflows will need to be manually approved before they run. --> ## Brief summary This update improves the watcher to support, for example, adding a cover image to an existing library item folder and triggering a re-scan for that item. ## Which issue is fixed? Fixes #4245 ## In-depth Description When the watcher detects files added/removed in a library folder it groups the files into potential library item paths. That grouping process distinguishes between media files and other files for the purpose of ignoring folders that only have non-media files. Other files are included in the grouping only if there is a media file in that potential library item group. Note: These groups are "potential" library items because at that stage it is not confirmed whether those paths are existing library items. This update changes that to allow for "scannable" non-media files (e.g. txt, nfo, png, json) to be included in the library item grouping even if it is the only file. ## How have you tested this? 1. Create a new folder with a single audio file and ensure it is added to the library with no cover image. 2. Add a cover image to the folder 3. Observe the watcher is triggered and the cover image is applied to the library item --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
adam added the pull-request label 2026-04-25 00:18:44 +02:00
adam closed this issue 2026-04-25 00:18:44 +02:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/audiobookshelf#4197