1
0
Fork 0
mirror of https://github.com/Radarr/Radarr synced 2024-12-21 23:42:23 +00:00

New: Add Languages to Webhook Notifications

(cherry picked from commit e039dc45e267cf717e00c0a49ba637012f37e3d7)

Closes #10733
This commit is contained in:
Stevie Robinson 2024-12-02 01:16:36 +01:00 committed by Bogdan
parent a6d727fe2a
commit 9a107cc8d7
3 changed files with 10 additions and 0 deletions

View file

@ -1,6 +1,7 @@
using System.Collections.Generic;
using System.IO;
using System.Linq;
using NzbDrone.Core.Languages;
using NzbDrone.Core.MediaFiles;
using NzbDrone.Core.Movies;
@ -20,6 +21,7 @@ public class WebhookMovie
public List<string> Genres { get; set; }
public List<WebhookImage> Images { get; set; }
public List<string> Tags { get; set; }
public Language OriginalLanguage { get; set; }
public WebhookMovie()
{
@ -38,6 +40,7 @@ public WebhookMovie(Movie movie, List<string> tags)
Genres = movie.MovieMetadata.Value.Genres;
Images = movie.MovieMetadata.Value.Images.Select(i => new WebhookImage(i)).ToList();
Tags = tags;
OriginalLanguage = movie.MovieMetadata.Value.OriginalLanguage;
}
public WebhookMovie(Movie movie, MovieFile movieFile, List<string> tags)

View file

@ -1,4 +1,6 @@
using System;
using System.Collections.Generic;
using NzbDrone.Core.Languages;
using NzbDrone.Core.MediaFiles;
namespace NzbDrone.Core.Notifications.Webhook
@ -21,6 +23,7 @@ public WebhookMovieFile(MovieFile movieFile)
IndexerFlags = movieFile.IndexerFlags.ToString();
Size = movieFile.Size;
DateAdded = movieFile.DateAdded;
Languages = movieFile.Languages;
if (movieFile.MediaInfo != null)
{
@ -38,6 +41,7 @@ public WebhookMovieFile(MovieFile movieFile)
public string IndexerFlags { get; set; }
public long Size { get; set; }
public DateTime DateAdded { get; set; }
public List<Language> Languages { get; set; }
public WebhookMovieFileMediaInfo MediaInfo { get; set; }
public string SourcePath { get; set; }
public string RecycleBinPath { get; set; }

View file

@ -1,6 +1,7 @@
using System;
using System.Collections.Generic;
using System.Linq;
using NzbDrone.Core.Languages;
using NzbDrone.Core.Parser.Model;
using NzbDrone.Core.Qualities;
@ -22,6 +23,7 @@ public WebhookRelease(QualityModel quality, RemoteMovie remoteMovie)
Size = remoteMovie.Release.Size;
CustomFormats = remoteMovie.CustomFormats?.Select(x => x.Name).ToList();
CustomFormatScore = remoteMovie.CustomFormatScore;
Languages = remoteMovie.Languages;
IndexerFlags = Enum.GetValues(typeof(IndexerFlags)).Cast<IndexerFlags>().Where(r => (remoteMovie.Release.IndexerFlags & r) == r).Select(r => r.ToString()).ToList();
}
@ -33,6 +35,7 @@ public WebhookRelease(QualityModel quality, RemoteMovie remoteMovie)
public long Size { get; set; }
public int CustomFormatScore { get; set; }
public List<string> CustomFormats { get; set; }
public List<Language> Languages { get; set; }
public List<string> IndexerFlags { get; set; }
}
}