1
0
mirror of https://github.com/Radarr/Radarr.git synced 2024-07-02 10:22:21 +02:00

Compare commits

...

2 Commits

Author SHA1 Message Date
mrpimpky
994f57c48a
Merge 67e1ae7e60 into 4cbf5cfc57 2024-06-12 18:18:14 +02:00
Mr.Pimpky
67e1ae7e60 New: Provide more Options to choose File Date from 2023-12-18 16:02:49 +01:00
5 changed files with 69 additions and 4 deletions

View File

@ -76,6 +76,24 @@ const fileDateOptions = [
get value() { get value() {
return translate('PhysicalReleaseDate'); return translate('PhysicalReleaseDate');
} }
},
{
key: 'cinemasOrRelease',
get value() {
return translate('InCinemasOrPhysicalReleaseDate');
}
},
{
key: 'oldest',
get value() {
return translate('OldestDate');
}
},
{
key: 'latest',
get value() {
return translate('LatestDate');
}
} }
]; ];

View File

@ -730,6 +730,7 @@
"Importing": "Importing", "Importing": "Importing",
"InCinemas": "In Cinemas", "InCinemas": "In Cinemas",
"InCinemasDate": "In Cinemas Date", "InCinemasDate": "In Cinemas Date",
"InCinemasOrPhysicalReleaseDate": "In Cinemas or Physical Release Date",
"InCinemasMsg": "Movie is in Cinemas", "InCinemasMsg": "Movie is in Cinemas",
"IncludeCustomFormatWhenRenaming": "Include Custom Format when Renaming", "IncludeCustomFormatWhenRenaming": "Include Custom Format when Renaming",
"IncludeCustomFormatWhenRenamingHelpText": "Include in {Custom Formats} renaming format", "IncludeCustomFormatWhenRenamingHelpText": "Include in {Custom Formats} renaming format",
@ -803,6 +804,7 @@
"LastExecution": "Last Execution", "LastExecution": "Last Execution",
"LastUsed": "Last Used", "LastUsed": "Last Used",
"LastWriteTime": "Last Write Time", "LastWriteTime": "Last Write Time",
"LatestDate": "Latest Date",
"LaunchBrowserHelpText": " Open a web browser and navigate to the {appName} homepage on app start.", "LaunchBrowserHelpText": " Open a web browser and navigate to the {appName} homepage on app start.",
"Letterboxd": "Letterboxd", "Letterboxd": "Letterboxd",
"Level": "Level", "Level": "Level",
@ -1204,6 +1206,7 @@
"NzbgetHistoryItemMessage": "PAR Status: {parStatus} - Unpack Status: {unpackStatus} - Move Status: {moveStatus} - Script Status: {scriptStatus} - Delete Status: {deleteStatus} - Mark Status: {markStatus}", "NzbgetHistoryItemMessage": "PAR Status: {parStatus} - Unpack Status: {unpackStatus} - Move Status: {moveStatus} - Script Status: {scriptStatus} - Delete Status: {deleteStatus} - Mark Status: {markStatus}",
"OAuthPopupMessage": "Pop-ups are being blocked by your browser", "OAuthPopupMessage": "Pop-ups are being blocked by your browser",
"Ok": "Ok", "Ok": "Ok",
"OldestDate": "Oldest Date",
"OnApplicationUpdate": "On Application Update", "OnApplicationUpdate": "On Application Update",
"OnExcludedList": "On Excluded List", "OnExcludedList": "On Excluded List",
"OnGrab": "On Grab", "OnGrab": "On Grab",

View File

@ -1,9 +1,12 @@
namespace NzbDrone.Core.MediaFiles namespace NzbDrone.Core.MediaFiles
{ {
public enum FileDateType public enum FileDateType
{ {
None = 0, None = 0,
Cinemas = 1, Cinemas = 1,
Release = 2 Release = 2,
CinemasOrRelease = 3,
Oldest = 4,
Latest = 5
} }
} }

View File

@ -70,6 +70,44 @@ private bool ChangeFileDate(MovieFile movieFile, Movie movie)
return ChangeFileDate(movieFilePath, airDate.Value); return ChangeFileDate(movieFilePath, airDate.Value);
} }
case FileDateType.CinemasOrRelease:
{
var finalDate = movie.MovieMetadata.Value.InCinemas ?? movie.MovieMetadata.Value.PhysicalRelease ?? movie.MovieMetadata.Value.DigitalRelease;
if (finalDate.HasValue == false)
{
return false;
}
return ChangeFileDate(movieFilePath, finalDate.Value);
}
case FileDateType.Oldest:
{
var oldestDate = new[] { movie.MovieMetadata.Value.InCinemas, movie.MovieMetadata.Value.PhysicalRelease, movie.MovieMetadata.Value.DigitalRelease }
.Where(d => d.HasValue).OrderBy(d => d).FirstOrDefault();
if (oldestDate.HasValue == false)
{
return false;
}
return ChangeFileDate(movieFilePath, oldestDate.Value);
}
case FileDateType.Latest:
{
var latestDate = new[] { movie.MovieMetadata.Value.InCinemas, movie.MovieMetadata.Value.PhysicalRelease, movie.MovieMetadata.Value.DigitalRelease }
.Where(d => d.HasValue).OrderBy(d => d).LastOrDefault();
if (latestDate.HasValue == false)
{
return false;
}
return ChangeFileDate(movieFilePath, latestDate.Value);
}
} }
return false; return false;

View File

@ -9150,7 +9150,10 @@
"enum": [ "enum": [
"none", "none",
"cinemas", "cinemas",
"release" "release",
"cinemasOrRelease",
"oldest",
"latest"
], ],
"type": "string" "type": "string"
}, },
@ -12508,4 +12511,4 @@
"apikey": [ ] "apikey": [ ]
} }
] ]
} }