mirror of
https://github.com/Radarr/Radarr.git
synced 2024-10-02 06:07:19 +02:00
New: Provide more Options to choose File Date from
This commit is contained in:
parent
119cdf6f09
commit
67e1ae7e60
@ -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');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
|
||||||
|
@ -516,6 +516,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",
|
||||||
@ -572,6 +573,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",
|
||||||
@ -769,6 +771,7 @@
|
|||||||
"NotificationTriggersHelpText": "Select which events should trigger this notification",
|
"NotificationTriggersHelpText": "Select which events should trigger this notification",
|
||||||
"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",
|
||||||
"OnApplicationUpdateHelpText": "On Application Update",
|
"OnApplicationUpdateHelpText": "On Application Update",
|
||||||
"OnDownloadHelpText": "On Import",
|
"OnDownloadHelpText": "On Import",
|
||||||
|
@ -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
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -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;
|
||||||
|
@ -9674,7 +9674,10 @@
|
|||||||
"enum": [
|
"enum": [
|
||||||
"none",
|
"none",
|
||||||
"cinemas",
|
"cinemas",
|
||||||
"release"
|
"release",
|
||||||
|
"cinemasOrRelease",
|
||||||
|
"oldest",
|
||||||
|
"latest"
|
||||||
],
|
],
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
|
Loading…
Reference in New Issue
Block a user