mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-07-16 05:43:54 +03:00
nfo saver makes unneccesary disk writes during library scan #6432
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @srosorcxisto on GitHub (Nov 6, 2024).
This issue respects the following points:
Description of the bug
When re-scanning a library using the .nfo saver, all .nfo files are updated even if there were no changes.
While mostly benign, this does result in unnecessary disk writes and cause some backup software and software-based raid systems (like SnapRAID) to treat the file as new because of the changed timestamp. I am not sure if this is a bug for feature request, so apologies if it is misfiled.
I believe this operation is being handled by SaveToFileAsync () on line 204 of jellyfin/MediaBrowser.XbmcMetadata/Savers/BaseNfoSaver.cs
I am not a C# programmer, nor am I familiar with the codebase and am therefore uncomfortable submitting a pull request on my own, but believe that this could be improved without noticeably impacting scan performance by adding a simple CRC32 hash to compare the stream with the existing file before writing.
Here is my attempt at a patch if helpful, I am not confident that it will work as written, but hate pointing out problems without at least suggesting a solution:
Reproduction steps
What is the current bug behavior?
After each library scan with nfo saver on, all .nfo files are recreated regardless of changes to the metadata.
What is the expected correct behavior?
That only new and changed .nfo files are added to the filesystem.
Jellyfin Server version
10.10.0+
Specify commit id
No response
Specify unstable release number
No response
Specify version number
No response
Specify the build version
10.10.1
Environment
Jellyfin logs
None relevant
FFmpeg logs
None relevant
Client / Browser logs
None relevant
Relevant screenshots or videos
None relevant
Additional information
@felix920506 commented on GitHub (Nov 6, 2024):
Please submit a PR if you have a fix.
@srosorcxisto commented on GitHub (Nov 7, 2024):
I have the outline of a fix, but am not familiar enough with C# to test or fully implement in a PR.
@IDisposable commented on GitHub (Feb 12, 2025):
I created PR #13547 for this.
@jellyfin-bot commented on GitHub (Jun 12, 2025):
This issue has gone 120 days without an update and will be closed within 21 days if there is no new activity. To prevent this issue from being closed, please confirm the issue has not already been fixed by providing updated examples or logs.
If you have any questions you can use one of several ways to contact us.
@jellyfin-bot commented on GitHub (Jul 3, 2025):
This issue was closed due to inactivity.