1
0
mirror of https://github.com/Radarr/Radarr.git synced 2024-06-30 17:43:59 +02:00
This commit is contained in:
mrpimpky 2024-06-20 18:12:07 +03:00 committed by GitHub
commit 4cf50a317a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 69 additions and 4 deletions

View File

@ -76,6 +76,24 @@ const fileDateOptions = [
get value() {
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

@ -735,6 +735,7 @@
"Importing": "Importing",
"InCinemas": "In Cinemas",
"InCinemasDate": "In Cinemas Date",
"InCinemasOrPhysicalReleaseDate": "In Cinemas or Physical Release Date",
"InCinemasMsg": "Movie is in Cinemas",
"IncludeCustomFormatWhenRenaming": "Include Custom Format when Renaming",
"IncludeCustomFormatWhenRenamingHelpText": "Include in {Custom Formats} renaming format",
@ -808,6 +809,7 @@
"LastExecution": "Last Execution",
"LastUsed": "Last Used",
"LastWriteTime": "Last Write Time",
"LatestDate": "Latest Date",
"LaunchBrowserHelpText": " Open a web browser and navigate to the {appName} homepage on app start.",
"Letterboxd": "Letterboxd",
"Level": "Level",
@ -1209,6 +1211,7 @@
"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",
"Ok": "Ok",
"OldestDate": "Oldest Date",
"OnApplicationUpdate": "On Application Update",
"OnExcludedList": "On Excluded List",
"OnGrab": "On Grab",

View File

@ -1,9 +1,12 @@
namespace NzbDrone.Core.MediaFiles
namespace NzbDrone.Core.MediaFiles
{
public enum FileDateType
{
None = 0,
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);
}
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;

View File

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