diff --git a/src/Sonarr.Api.V3/EpisodeFiles/EpisodeFileListResource.cs b/src/Sonarr.Api.V3/EpisodeFiles/EpisodeFileListResource.cs index 4a540fe52..07f063236 100644 --- a/src/Sonarr.Api.V3/EpisodeFiles/EpisodeFileListResource.cs +++ b/src/Sonarr.Api.V3/EpisodeFiles/EpisodeFileListResource.cs @@ -9,5 +9,7 @@ public class EpisodeFileListResource public List EpisodeFileIds { get; set; } public Language Language { get; set; } public QualityModel Quality { get; set; } + public string SceneName { get; set; } + public string ReleaseGroup { get; set; } } } diff --git a/src/Sonarr.Api.V3/EpisodeFiles/EpisodeFileModule.cs b/src/Sonarr.Api.V3/EpisodeFiles/EpisodeFileModule.cs index 6dafd0f31..6fb6c4837 100644 --- a/src/Sonarr.Api.V3/EpisodeFiles/EpisodeFileModule.cs +++ b/src/Sonarr.Api.V3/EpisodeFiles/EpisodeFileModule.cs @@ -9,6 +9,7 @@ using NzbDrone.Core.MediaFiles; using NzbDrone.Core.MediaFiles.Events; using NzbDrone.Core.Messaging.Events; +using NzbDrone.Core.Parser; using NzbDrone.Core.Tv; using NzbDrone.SignalR; using Sonarr.Http; @@ -94,6 +95,17 @@ private void SetQuality(EpisodeFileResource episodeFileResource) { var episodeFile = _mediaFileService.Get(episodeFileResource.Id); episodeFile.Quality = episodeFileResource.Quality; + + if (episodeFileResource.SceneName != null && SceneChecker.IsSceneTitle(episodeFileResource.SceneName)) + { + episodeFile.SceneName = episodeFileResource.SceneName; + } + + if (episodeFileResource.ReleaseGroup != null) + { + episodeFile.ReleaseGroup = episodeFileResource.ReleaseGroup; + } + _mediaFileService.Update(episodeFile); } @@ -113,6 +125,16 @@ private object SetQuality() { episodeFile.Quality = resource.Quality; } + + if (resource.SceneName != null && SceneChecker.IsSceneTitle(resource.SceneName)) + { + episodeFile.SceneName = resource.SceneName; + } + + if (resource.ReleaseGroup != null) + { + episodeFile.ReleaseGroup = resource.ReleaseGroup; + } } _mediaFileService.Update(episodeFiles); diff --git a/src/Sonarr.Api.V3/EpisodeFiles/EpisodeFileResource.cs b/src/Sonarr.Api.V3/EpisodeFiles/EpisodeFileResource.cs index cfbc65b83..0dbe2f66d 100644 --- a/src/Sonarr.Api.V3/EpisodeFiles/EpisodeFileResource.cs +++ b/src/Sonarr.Api.V3/EpisodeFiles/EpisodeFileResource.cs @@ -18,6 +18,7 @@ public class EpisodeFileResource : RestResource public long Size { get; set; } public DateTime DateAdded { get; set; } public string SceneName { get; set; } + public string ReleaseGroup { get; set; } public Language Language { get; set; } public QualityModel Quality { get; set; } public MediaInfoResource MediaInfo { get; set; } @@ -43,6 +44,7 @@ private static EpisodeFileResource ToResource(this EpisodeFile model) Size = model.Size, DateAdded = model.DateAdded, SceneName = model.SceneName, + ReleaseGroup = model.ReleaseGroup, Language = model.Language, Quality = model.Quality, MediaInfo = model.MediaInfo.ToResource(model.SceneName) @@ -66,6 +68,7 @@ public static EpisodeFileResource ToResource(this EpisodeFile model, NzbDrone.Co Size = model.Size, DateAdded = model.DateAdded, SceneName = model.SceneName, + ReleaseGroup = model.ReleaseGroup, Language = model.Language, Quality = model.Quality, MediaInfo = model.MediaInfo.ToResource(model.SceneName),