mirror of
https://github.com/Radarr/Radarr
synced 2026-05-09 11:10:23 +02:00
New: Add Languages to Webhook Notifications
(cherry picked from commit e039dc45e267cf717e00c0a49ba637012f37e3d7) Closes #10733
This commit is contained in:
parent
a6d727fe2a
commit
9a107cc8d7
3 changed files with 10 additions and 0 deletions
|
|
@ -1,6 +1,7 @@
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
using NzbDrone.Core.Languages;
|
||||||
using NzbDrone.Core.MediaFiles;
|
using NzbDrone.Core.MediaFiles;
|
||||||
using NzbDrone.Core.Movies;
|
using NzbDrone.Core.Movies;
|
||||||
|
|
||||||
|
|
@ -20,6 +21,7 @@ public class WebhookMovie
|
||||||
public List<string> Genres { get; set; }
|
public List<string> Genres { get; set; }
|
||||||
public List<WebhookImage> Images { get; set; }
|
public List<WebhookImage> Images { get; set; }
|
||||||
public List<string> Tags { get; set; }
|
public List<string> Tags { get; set; }
|
||||||
|
public Language OriginalLanguage { get; set; }
|
||||||
|
|
||||||
public WebhookMovie()
|
public WebhookMovie()
|
||||||
{
|
{
|
||||||
|
|
@ -38,6 +40,7 @@ public WebhookMovie(Movie movie, List<string> tags)
|
||||||
Genres = movie.MovieMetadata.Value.Genres;
|
Genres = movie.MovieMetadata.Value.Genres;
|
||||||
Images = movie.MovieMetadata.Value.Images.Select(i => new WebhookImage(i)).ToList();
|
Images = movie.MovieMetadata.Value.Images.Select(i => new WebhookImage(i)).ToList();
|
||||||
Tags = tags;
|
Tags = tags;
|
||||||
|
OriginalLanguage = movie.MovieMetadata.Value.OriginalLanguage;
|
||||||
}
|
}
|
||||||
|
|
||||||
public WebhookMovie(Movie movie, MovieFile movieFile, List<string> tags)
|
public WebhookMovie(Movie movie, MovieFile movieFile, List<string> tags)
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,6 @@
|
||||||
using System;
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using NzbDrone.Core.Languages;
|
||||||
using NzbDrone.Core.MediaFiles;
|
using NzbDrone.Core.MediaFiles;
|
||||||
|
|
||||||
namespace NzbDrone.Core.Notifications.Webhook
|
namespace NzbDrone.Core.Notifications.Webhook
|
||||||
|
|
@ -21,6 +23,7 @@ public WebhookMovieFile(MovieFile movieFile)
|
||||||
IndexerFlags = movieFile.IndexerFlags.ToString();
|
IndexerFlags = movieFile.IndexerFlags.ToString();
|
||||||
Size = movieFile.Size;
|
Size = movieFile.Size;
|
||||||
DateAdded = movieFile.DateAdded;
|
DateAdded = movieFile.DateAdded;
|
||||||
|
Languages = movieFile.Languages;
|
||||||
|
|
||||||
if (movieFile.MediaInfo != null)
|
if (movieFile.MediaInfo != null)
|
||||||
{
|
{
|
||||||
|
|
@ -38,6 +41,7 @@ public WebhookMovieFile(MovieFile movieFile)
|
||||||
public string IndexerFlags { get; set; }
|
public string IndexerFlags { get; set; }
|
||||||
public long Size { get; set; }
|
public long Size { get; set; }
|
||||||
public DateTime DateAdded { get; set; }
|
public DateTime DateAdded { get; set; }
|
||||||
|
public List<Language> Languages { get; set; }
|
||||||
public WebhookMovieFileMediaInfo MediaInfo { get; set; }
|
public WebhookMovieFileMediaInfo MediaInfo { get; set; }
|
||||||
public string SourcePath { get; set; }
|
public string SourcePath { get; set; }
|
||||||
public string RecycleBinPath { get; set; }
|
public string RecycleBinPath { get; set; }
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
using NzbDrone.Core.Languages;
|
||||||
using NzbDrone.Core.Parser.Model;
|
using NzbDrone.Core.Parser.Model;
|
||||||
using NzbDrone.Core.Qualities;
|
using NzbDrone.Core.Qualities;
|
||||||
|
|
||||||
|
|
@ -22,6 +23,7 @@ public WebhookRelease(QualityModel quality, RemoteMovie remoteMovie)
|
||||||
Size = remoteMovie.Release.Size;
|
Size = remoteMovie.Release.Size;
|
||||||
CustomFormats = remoteMovie.CustomFormats?.Select(x => x.Name).ToList();
|
CustomFormats = remoteMovie.CustomFormats?.Select(x => x.Name).ToList();
|
||||||
CustomFormatScore = remoteMovie.CustomFormatScore;
|
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();
|
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 long Size { get; set; }
|
||||||
public int CustomFormatScore { get; set; }
|
public int CustomFormatScore { get; set; }
|
||||||
public List<string> CustomFormats { get; set; }
|
public List<string> CustomFormats { get; set; }
|
||||||
|
public List<Language> Languages { get; set; }
|
||||||
public List<string> IndexerFlags { get; set; }
|
public List<string> IndexerFlags { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue