1
0
mirror of https://github.com/Radarr/Radarr.git synced 2024-11-04 10:02:40 +01:00

New: Update scenename from API (#6132)

* update scenename from API

* Update MovieFileListResource.cs

* Update MovieFileModule.cs

null checks similar to Sonarr pull request

* Update MovieFileModule.cs

add blank line

* Update MovieFileModule.cs

include isSceneTitle check

* Update MovieFileModule.cs

fix namespace

* Update MovieFileModule.cs
This commit is contained in:
Michael Higgins 2021-05-15 18:08:04 -04:00 committed by GitHub
parent 5f229b78be
commit db14ac4605
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 17 additions and 1 deletions

View File

@ -12,6 +12,7 @@ public class MovieFileListResource
public QualityModel Quality { get; set; }
public string Edition { get; set; }
public string ReleaseGroup { get; set; }
public string SceneName { get; set; }
public int? IndexerFlags { get; set; }
}
}

View File

@ -11,6 +11,7 @@
using NzbDrone.Core.MediaFiles.Events;
using NzbDrone.Core.Messaging.Events;
using NzbDrone.Core.Movies;
using NzbDrone.Core.Parser;
using NzbDrone.Core.Parser.Model;
using NzbDrone.SignalR;
using Radarr.Api.V3.CustomFormats;
@ -115,7 +116,16 @@ private void SetMovieFile(MovieFileResource movieFileResource)
movieFile.Quality = movieFileResource.Quality;
movieFile.Languages = movieFileResource.Languages;
movieFile.Edition = movieFileResource.Edition;
if (movieFileResource.ReleaseGroup != null)
{
movieFile.ReleaseGroup = movieFileResource.ReleaseGroup;
}
if (movieFileResource.SceneName != null && SceneChecker.IsSceneTitle(movieFileResource.SceneName))
{
movieFile.SceneName = movieFileResource.SceneName;
}
_mediaFileService.Update(movieFile);
}
@ -151,6 +161,11 @@ private object SetMovieFile()
{
movieFile.ReleaseGroup = resource.ReleaseGroup;
}
if (resource.SceneName != null && SceneChecker.IsSceneTitle(resource.SceneName))
{
movieFile.SceneName = resource.SceneName;
}
}
_mediaFileService.Update(movieFiles);