mirror of
https://github.com/Radarr/Radarr
synced 2025-02-23 14:51:17 +00:00
parent
99ab65f790
commit
f9cd9f3204
1 changed files with 4 additions and 2 deletions
|
@ -22,12 +22,14 @@ public ManualImportController(IManualImportService manualImportService)
|
||||||
}
|
}
|
||||||
|
|
||||||
[HttpGet]
|
[HttpGet]
|
||||||
|
[Produces("application/json")]
|
||||||
public List<ManualImportResource> GetMediaFiles(string folder, string downloadId, int? movieId, bool filterExistingFiles = true)
|
public List<ManualImportResource> GetMediaFiles(string folder, string downloadId, int? movieId, bool filterExistingFiles = true)
|
||||||
{
|
{
|
||||||
return _manualImportService.GetMediaFiles(folder, downloadId, movieId, filterExistingFiles).ToResource().Select(AddQualityWeight).ToList();
|
return _manualImportService.GetMediaFiles(folder, downloadId, movieId, filterExistingFiles).ToResource().Select(AddQualityWeight).ToList();
|
||||||
}
|
}
|
||||||
|
|
||||||
[HttpPost]
|
[HttpPost]
|
||||||
|
[Consumes("application/json")]
|
||||||
public object ReprocessItems([FromBody] List<ManualImportReprocessResource> items)
|
public object ReprocessItems([FromBody] List<ManualImportReprocessResource> items)
|
||||||
{
|
{
|
||||||
foreach (var item in items)
|
foreach (var item in items)
|
||||||
|
@ -39,8 +41,8 @@ public object ReprocessItems([FromBody] List<ManualImportReprocessResource> item
|
||||||
item.CustomFormats = processedItem.CustomFormats.ToResource(false);
|
item.CustomFormats = processedItem.CustomFormats.ToResource(false);
|
||||||
item.CustomFormatScore = processedItem.CustomFormatScore;
|
item.CustomFormatScore = processedItem.CustomFormatScore;
|
||||||
|
|
||||||
if (item.Languages?.Count <= 1 && (item.Languages?.SingleOrDefault() ?? Language.Unknown) == Language.Unknown &&
|
// Only set the language/quality if they're unknown and languages were returned.
|
||||||
processedItem.Languages.Any())
|
if (item.Languages?.Count <= 1 && (item.Languages?.SingleOrDefault() ?? Language.Unknown) == Language.Unknown && processedItem.Languages.Any())
|
||||||
{
|
{
|
||||||
item.Languages = processedItem.Languages;
|
item.Languages = processedItem.Languages;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue