Music library album cover image files are getting wiped when using "Refresh all metadata" wtith "Replace existing images" #6264

Closed
opened 2026-02-07 03:21:47 +03:00 by OVERLORD · 2 comments
Owner

Originally created by @sel10ut on GitHub (Sep 12, 2024).

This issue respects the following points:

  • This is a bug, not a question or a configuration issue; Please visit our forum or chat rooms first to troubleshoot with volunteers, before creating a report. The links can be found here.
  • This issue is not already reported on GitHub (I've searched it).
  • I'm using an up to date version of Jellyfin Server stable, unstable or master; We generally do not support previous older versions. If possible, please update to the latest version before opening an issue.
  • I agree to follow Jellyfin's Code of Conduct.
  • This report addresses only a single issue; If you encounter multiple issues, kindly create separate reports for each one.

Description of the bug

After running the manual refresh on a music album, the album cover image that is stored in a directory together with audio files (like cover.jpg) is getting deleted. When setting the library source to read-only, it tries to remove the file, and the error appears (log attached)

Reproduction steps

  1. Using the web client, navigate to a music library
  2. Click 3 dots on a music album, select "Refresh metadata"
  3. Select refresh mode "Replace all metadata"
  4. Check "Replace existing images"

What is the current bug behavior?

Cover source image files are getting deleted

What is the expected correct behavior?

Do not touch any source files

Jellyfin Server version

Master

Specify commit id

751e12e5b5

Specify unstable release number

No response

Specify version number

No response

Specify the build version

Release

Environment

- OS: Linux
- Linux Kernel:
- Virtualization: No virtualization (host), podman
- Clients:
- Browser:
- FFmpeg Version:
- Playback Method:
- Hardware Acceleration:
- GPU Model:
- Plugins:
- Reverse Proxy:
- Base URL:
- Networking:
- Storage: smb, local

Jellyfin logs

[ERR] [8] MediaBrowser.Providers.Manager.ProviderManager: Error refreshing item
System.IO.IOException: Read-only file system : '*/cover.jpg'
   at System.IO.FileSystem.DeleteFile(String fullPath)
   at Emby.Server.Implementations.IO.ManagedFileSystem.DeleteFile(String path) in */Emby.Server.Implementations/IO/ManagedFileSystem.cs:line 526
   at MediaBrowser.Providers.Manager.ItemImageProvider.PruneImages(BaseItem item, IReadOnlyList`1 images) in */MediaBrowser.Providers/Manager/ItemImageProvider.cs:line 369
   at MediaBrowser.Providers.Manager.ItemImageProvider.RemoveImages(BaseItem item) in */MediaBrowser.Providers/Manager/ItemImageProvider.cs:line 85
   at MediaBrowser.Providers.Manager.MetadataService`2.RefreshMetadata(BaseItem item, MetadataRefreshOptions refreshOptions, CancellationToken cancellationToken) in */MediaBrowser.Providers/Manager/MetadataService.cs:line 97
   at MediaBrowser.Controller.Entities.BaseItem.RefreshMetadata(MetadataRefreshOptions options, CancellationToken cancellationToken) in */MediaBrowser.Controller/Entities/BaseItem.cs:line 1297
   at MediaBrowser.Providers.Manager.ProviderManager.RefreshItem(BaseItem item, MetadataRefreshOptions options, CancellationToken cancellationToken) in */MediaBrowser.Providers/Manager/ProviderManager.cs:line 1092
   at MediaBrowser.Providers.Manager.ProviderManager.StartProcessingRefreshQueue() in */MediaBrowser.Providers/Manager/ProviderManager.cs:line 1072

FFmpeg logs

No response

Client / Browser logs

No response

Relevant screenshots or videos

No response

Additional information

git bisect log
bad commit: 1c106e8323
bad hunk:

diff --git a/Jellyfin.Api/Controllers/ItemRefreshController.cs b/Jellyfin.Api/Controllers/ItemRefreshController.cs
index c1343b130..d7a8c37c4 100644
--- a/Jellyfin.Api/Controllers/ItemRefreshController.cs
+++ b/Jellyfin.Api/Controllers/ItemRefreshController.cs
@@ -80,7 +80,8 @@ public class ItemRefreshController : BaseJellyfinApiController
                 || imageRefreshMode == MetadataRefreshMode.FullRefresh
                 || replaceAllImages
                 || replaceAllMetadata,
-            IsAutomated = false
+            IsAutomated = false,
+            RemoveOldMetadata = replaceAllMetadata
         };
Originally created by @sel10ut on GitHub (Sep 12, 2024). ### This issue respects the following points: - [X] This is a **bug**, not a question or a configuration issue; Please visit our forum or chat rooms first to troubleshoot with volunteers, before creating a report. The links can be found [here](https://jellyfin.org/contact/). - [X] This issue is **not** already reported on [GitHub](https://github.com/jellyfin/jellyfin/issues?q=is%3Aopen+is%3Aissue) _(I've searched it)_. - [X] I'm using an up to date version of Jellyfin Server stable, unstable or master; We generally do not support previous older versions. If possible, please update to the latest version before opening an issue. - [X] I agree to follow Jellyfin's [Code of Conduct](https://jellyfin.org/docs/general/community-standards.html#code-of-conduct). - [X] This report addresses only a single issue; If you encounter multiple issues, kindly create separate reports for each one. ### Description of the bug After running the manual refresh on a music album, the album cover image that is stored in a directory together with audio files (like cover.jpg) is getting deleted. When setting the library source to read-only, it tries to remove the file, and the error appears (log attached) ### Reproduction steps 1. Using the web client, navigate to a music library 2. Click 3 dots on a music album, select "Refresh metadata" 3. Select refresh mode "Replace all metadata" 4. Check "Replace existing images" ### What is the current _bug_ behavior? Cover source image files are getting deleted ### What is the expected _correct_ behavior? Do not touch any source files ### Jellyfin Server version Master ### Specify commit id 751e12e5b5c59f9df4494251166f47c8cf9ebfe1 ### Specify unstable release number _No response_ ### Specify version number _No response_ ### Specify the build version Release ### Environment ```markdown - OS: Linux - Linux Kernel: - Virtualization: No virtualization (host), podman - Clients: - Browser: - FFmpeg Version: - Playback Method: - Hardware Acceleration: - GPU Model: - Plugins: - Reverse Proxy: - Base URL: - Networking: - Storage: smb, local ``` ### Jellyfin logs ```shell [ERR] [8] MediaBrowser.Providers.Manager.ProviderManager: Error refreshing item System.IO.IOException: Read-only file system : '*/cover.jpg' at System.IO.FileSystem.DeleteFile(String fullPath) at Emby.Server.Implementations.IO.ManagedFileSystem.DeleteFile(String path) in */Emby.Server.Implementations/IO/ManagedFileSystem.cs:line 526 at MediaBrowser.Providers.Manager.ItemImageProvider.PruneImages(BaseItem item, IReadOnlyList`1 images) in */MediaBrowser.Providers/Manager/ItemImageProvider.cs:line 369 at MediaBrowser.Providers.Manager.ItemImageProvider.RemoveImages(BaseItem item) in */MediaBrowser.Providers/Manager/ItemImageProvider.cs:line 85 at MediaBrowser.Providers.Manager.MetadataService`2.RefreshMetadata(BaseItem item, MetadataRefreshOptions refreshOptions, CancellationToken cancellationToken) in */MediaBrowser.Providers/Manager/MetadataService.cs:line 97 at MediaBrowser.Controller.Entities.BaseItem.RefreshMetadata(MetadataRefreshOptions options, CancellationToken cancellationToken) in */MediaBrowser.Controller/Entities/BaseItem.cs:line 1297 at MediaBrowser.Providers.Manager.ProviderManager.RefreshItem(BaseItem item, MetadataRefreshOptions options, CancellationToken cancellationToken) in */MediaBrowser.Providers/Manager/ProviderManager.cs:line 1092 at MediaBrowser.Providers.Manager.ProviderManager.StartProcessingRefreshQueue() in */MediaBrowser.Providers/Manager/ProviderManager.cs:line 1072 ``` ### FFmpeg logs _No response_ ### Client / Browser logs _No response_ ### Relevant screenshots or videos _No response_ ### Additional information [git bisect log](https://github.com/user-attachments/files/16972019/bisect_log.txt) bad commit: 1c106e83230cea59077cc1e30a9229868c6a8558 bad hunk: ```diff diff --git a/Jellyfin.Api/Controllers/ItemRefreshController.cs b/Jellyfin.Api/Controllers/ItemRefreshController.cs index c1343b130..d7a8c37c4 100644 --- a/Jellyfin.Api/Controllers/ItemRefreshController.cs +++ b/Jellyfin.Api/Controllers/ItemRefreshController.cs @@ -80,7 +80,8 @@ public class ItemRefreshController : BaseJellyfinApiController || imageRefreshMode == MetadataRefreshMode.FullRefresh || replaceAllImages || replaceAllMetadata, - IsAutomated = false + IsAutomated = false, + RemoveOldMetadata = replaceAllMetadata }; ```
OVERLORD added the bug label 2026-02-07 03:21:47 +03:00
Author
Owner

@felix920506 commented on GitHub (Sep 12, 2024):

Do you have the save metadata in media folders option enabled?

@felix920506 commented on GitHub (Sep 12, 2024): Do you have the save metadata in media folders option enabled?
Author
Owner

@sel10ut commented on GitHub (Sep 12, 2024):

Do you have the save metadata in media folders option enabled?

if you mean "Save artwork into media folders" - No

@sel10ut commented on GitHub (Sep 12, 2024): > Do you have the save metadata in media folders option enabled? if you mean "Save artwork into media folders" - No
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/jellyfin#6264