1
0
Fork 0
mirror of https://github.com/Sonarr/Sonarr synced 2025-01-02 21:24:56 +00:00

New: Add Languages to Webhook Notifications

Closes #7421
This commit is contained in:
Stevie Robinson 2024-12-02 01:16:36 +01:00 committed by GitHub
parent 776143cc81
commit e039dc45e2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 10 additions and 0 deletions

View file

@ -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
@ -20,6 +22,7 @@ namespace NzbDrone.Core.Notifications.Webhook
SceneName = episodeFile.SceneName; SceneName = episodeFile.SceneName;
Size = episodeFile.Size; Size = episodeFile.Size;
DateAdded = episodeFile.DateAdded; DateAdded = episodeFile.DateAdded;
Languages = episodeFile.Languages;
if (episodeFile.MediaInfo != null) if (episodeFile.MediaInfo != null)
{ {
@ -36,6 +39,7 @@ namespace NzbDrone.Core.Notifications.Webhook
public string SceneName { get; set; } public string SceneName { 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 WebhookEpisodeFileMediaInfo MediaInfo { get; set; } public WebhookEpisodeFileMediaInfo MediaInfo { get; set; }
public string SourcePath { get; set; } public string SourcePath { get; set; }
public string RecycleBinPath { get; set; } public string RecycleBinPath { get; set; }

View file

@ -1,5 +1,6 @@
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;
@ -21,6 +22,7 @@ namespace NzbDrone.Core.Notifications.Webhook
Size = remoteEpisode.Release.Size; Size = remoteEpisode.Release.Size;
CustomFormats = remoteEpisode.CustomFormats?.Select(x => x.Name).ToList(); CustomFormats = remoteEpisode.CustomFormats?.Select(x => x.Name).ToList();
CustomFormatScore = remoteEpisode.CustomFormatScore; CustomFormatScore = remoteEpisode.CustomFormatScore;
Languages = remoteEpisode.Languages;
} }
public string Quality { get; set; } public string Quality { get; set; }
@ -31,5 +33,6 @@ namespace NzbDrone.Core.Notifications.Webhook
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; }
} }
} }

View file

@ -1,5 +1,6 @@
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using NzbDrone.Core.Languages;
using NzbDrone.Core.Tv; using NzbDrone.Core.Tv;
namespace NzbDrone.Core.Notifications.Webhook namespace NzbDrone.Core.Notifications.Webhook
@ -19,6 +20,7 @@ namespace NzbDrone.Core.Notifications.Webhook
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 WebhookSeries() public WebhookSeries()
{ {
@ -39,6 +41,7 @@ namespace NzbDrone.Core.Notifications.Webhook
Genres = series.Genres; Genres = series.Genres;
Images = series.Images.Select(i => new WebhookImage(i)).ToList(); Images = series.Images.Select(i => new WebhookImage(i)).ToList();
Tags = tags; Tags = tags;
OriginalLanguage = series.OriginalLanguage;
} }
} }
} }