mirror of
https://github.com/Radarr/Radarr.git
synced 2026-03-02 22:57:34 -05:00
Constant Updates to the Modified Timestamp of Movie Files #7354
Labels
No labels
Area: API
Area: Database
Area: Db-migration
Area: Download Clients
Area: Extras
Area: Import Lists
Area: Indexer
Area: Metadata API
Area: Notifications
Area: Organizer
Area: Parser
Area: Scanning
Area: Tooling
Area: UI
Area: Unit Tests
On Hold: MetadataAPI Blocking
On Hold: MetadataAPI Blocking
Priority: High
Priority: Low
Priority: Medium
Status: Accepted
Status: Cannot Reproduce
Status: Confirmed
Status: Help Wanted
Status: In Progress
Status: Indexer - need invite
Status: Info Needed
Status: Investigating
Status: Logs Needed
Status: Maybe One Day
Status: Needs Triage
Status: On Hold
Status: Ready for Review
Status: Unlikely
Status: Waiting for OP
Status: Won't Fix
Type: Bug
Type: Documentation
Type: Duplicate
Type: Enhancement
Type: External Bug
Type: Feature Request
Type: Regression
Type: Support
Type: Support.
conflict
lidarr-pull
no-conflict
not-pulled
readarr-pull
readarr-pull
sonarr upstream
sonarr-pull
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/Radarr#7354
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
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 @darthShadow on GitHub (Apr 18, 2023).
Is there an existing issue for this?
Current Behavior
There seems to be a loop in the implementation which is causing the constant updates:
This checks the date of the file with the actual date and updates the file timestamp if they are not equal:
github.com/Radarr/Radarr@1be450a9d0/src/NzbDrone.Core/MediaFiles/UpdateMovieFileService.cs (L84)This is the actual function updating the file which checks for pre-epoch values and sets them to epoch:
github.com/Radarr/Radarr@1be450a9d0/src/NzbDrone.Common/Disk/DiskProviderBase.cs (L336)The above 2 will result in the file never having a time older than epoch which will cause the first if check to always fail and always update the file timestamp to epoch.
Checking through the Sonarr source, it doesn't seem to have any similar check for pre-epoch values so I am not sure if it's even required now or not:
github.com/Sonarr/Sonarr@2303bff205/src/NzbDrone.Common/Disk/DiskProviderBase.cs (L322)Expected Behavior
The timestamp should be updated only once unless it changes again rather than happening on every scan.
Steps To Reproduce
Change File Dateoption toIn Cinemas Datein the SettingsEnvironment
What branch are you running?
Master
Trace Logs?
@Qstick commented on GitHub (May 1, 2023):
This would indeed cause a loop, however the epoch check was put into place due to exceptions being thrown when trying to set the file date to a pre-epoch value. We'd need to also check for pre-epoch in update movie file service to avoid the extra write every scan
@darthShadow commented on GitHub (May 2, 2023):
The issue (https://github.com/Radarr/Radarr/issues/1913) doesn't seem to have any OS details but it seems weird to have such an issue.
Ideally, setting times older than epoch should be a non-issue in any modern OS / FS combination and, as linked above, Sonarr doesn't have any such check.
Perhaps this could be removed now and see if anything breaks and add the condition only for that OS/FS combination?
@Qstick commented on GitHub (May 7, 2023):
In terms of FS, this likely happens on FAT file systems which count dates from
1/1/1980