mirror of
https://github.com/lidarr/lidarr.git
synced 2025-08-19 13:10:13 -07:00
Fixed: Fallback to Instance Name for Discord notifications
(cherry picked from commit b99e06acc0a3ecae2857d9225b35424c82c67a2b)
This commit is contained in:
parent
664b972494
commit
be115da157
1 changed files with 12 additions and 9 deletions
|
@ -3,6 +3,7 @@ using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using FluentValidation.Results;
|
using FluentValidation.Results;
|
||||||
using NzbDrone.Common.Extensions;
|
using NzbDrone.Common.Extensions;
|
||||||
|
using NzbDrone.Core.Configuration;
|
||||||
using NzbDrone.Core.MediaCover;
|
using NzbDrone.Core.MediaCover;
|
||||||
using NzbDrone.Core.MediaFiles;
|
using NzbDrone.Core.MediaFiles;
|
||||||
using NzbDrone.Core.Music;
|
using NzbDrone.Core.Music;
|
||||||
|
@ -14,10 +15,12 @@ namespace NzbDrone.Core.Notifications.Discord
|
||||||
public class Discord : NotificationBase<DiscordSettings>
|
public class Discord : NotificationBase<DiscordSettings>
|
||||||
{
|
{
|
||||||
private readonly IDiscordProxy _proxy;
|
private readonly IDiscordProxy _proxy;
|
||||||
|
private readonly IConfigFileProvider _configFileProvider;
|
||||||
|
|
||||||
public Discord(IDiscordProxy proxy)
|
public Discord(IDiscordProxy proxy, IConfigFileProvider configFileProvider)
|
||||||
{
|
{
|
||||||
_proxy = proxy;
|
_proxy = proxy;
|
||||||
|
_configFileProvider = configFileProvider;
|
||||||
}
|
}
|
||||||
|
|
||||||
public override string Name => "Discord";
|
public override string Name => "Discord";
|
||||||
|
@ -33,7 +36,7 @@ namespace NzbDrone.Core.Notifications.Discord
|
||||||
{
|
{
|
||||||
Author = new DiscordAuthor
|
Author = new DiscordAuthor
|
||||||
{
|
{
|
||||||
Name = Settings.Author.IsNullOrWhiteSpace() ? Environment.MachineName : Settings.Author,
|
Name = Settings.Author.IsNullOrWhiteSpace() ? _configFileProvider.InstanceName : Settings.Author,
|
||||||
IconUrl = "https://raw.githubusercontent.com/lidarr/Lidarr/develop/Logo/256.png"
|
IconUrl = "https://raw.githubusercontent.com/lidarr/Lidarr/develop/Logo/256.png"
|
||||||
},
|
},
|
||||||
Url = $"https://musicbrainz.org/artist/{artist.ForeignArtistId}",
|
Url = $"https://musicbrainz.org/artist/{artist.ForeignArtistId}",
|
||||||
|
@ -138,7 +141,7 @@ namespace NzbDrone.Core.Notifications.Discord
|
||||||
{
|
{
|
||||||
Author = new DiscordAuthor
|
Author = new DiscordAuthor
|
||||||
{
|
{
|
||||||
Name = Settings.Author.IsNullOrWhiteSpace() ? Environment.MachineName : Settings.Author,
|
Name = Settings.Author.IsNullOrWhiteSpace() ? _configFileProvider.InstanceName : Settings.Author,
|
||||||
IconUrl = "https://raw.githubusercontent.com/lidarr/Lidarr/develop/Logo/256.png"
|
IconUrl = "https://raw.githubusercontent.com/lidarr/Lidarr/develop/Logo/256.png"
|
||||||
},
|
},
|
||||||
Url = $"https://musicbrainz.org/artist/{artist.ForeignArtistId}",
|
Url = $"https://musicbrainz.org/artist/{artist.ForeignArtistId}",
|
||||||
|
@ -296,7 +299,7 @@ namespace NzbDrone.Core.Notifications.Discord
|
||||||
{
|
{
|
||||||
Author = new DiscordAuthor
|
Author = new DiscordAuthor
|
||||||
{
|
{
|
||||||
Name = Settings.Author.IsNullOrWhiteSpace() ? Environment.MachineName : Settings.Author,
|
Name = Settings.Author.IsNullOrWhiteSpace() ? _configFileProvider.InstanceName : Settings.Author,
|
||||||
IconUrl = "https://raw.githubusercontent.com/lidarr/Lidarr/develop/Logo/256.png"
|
IconUrl = "https://raw.githubusercontent.com/lidarr/Lidarr/develop/Logo/256.png"
|
||||||
},
|
},
|
||||||
Title = healthCheck.Source.Name,
|
Title = healthCheck.Source.Name,
|
||||||
|
@ -319,7 +322,7 @@ namespace NzbDrone.Core.Notifications.Discord
|
||||||
{
|
{
|
||||||
Author = new DiscordAuthor
|
Author = new DiscordAuthor
|
||||||
{
|
{
|
||||||
Name = Settings.Author.IsNullOrWhiteSpace() ? Environment.MachineName : Settings.Author,
|
Name = Settings.Author.IsNullOrWhiteSpace() ? _configFileProvider.InstanceName : Settings.Author,
|
||||||
IconUrl = "https://raw.githubusercontent.com/Lidarr/Lidarr/develop/Logo/256.png"
|
IconUrl = "https://raw.githubusercontent.com/Lidarr/Lidarr/develop/Logo/256.png"
|
||||||
},
|
},
|
||||||
Title = "Health Issue Resolved: " + previousCheck.Source.Name,
|
Title = "Health Issue Resolved: " + previousCheck.Source.Name,
|
||||||
|
@ -342,7 +345,7 @@ namespace NzbDrone.Core.Notifications.Discord
|
||||||
{
|
{
|
||||||
Author = new DiscordAuthor
|
Author = new DiscordAuthor
|
||||||
{
|
{
|
||||||
Name = Settings.Author.IsNullOrWhiteSpace() ? Environment.MachineName : Settings.Author,
|
Name = Settings.Author.IsNullOrWhiteSpace() ? _configFileProvider.InstanceName : Settings.Author,
|
||||||
IconUrl = "https://raw.githubusercontent.com/lidarr/Lidarr/develop/Logo/256.png"
|
IconUrl = "https://raw.githubusercontent.com/lidarr/Lidarr/develop/Logo/256.png"
|
||||||
},
|
},
|
||||||
Title = TRACK_RETAGGED_TITLE,
|
Title = TRACK_RETAGGED_TITLE,
|
||||||
|
@ -363,7 +366,7 @@ namespace NzbDrone.Core.Notifications.Discord
|
||||||
{
|
{
|
||||||
Author = new DiscordAuthor
|
Author = new DiscordAuthor
|
||||||
{
|
{
|
||||||
Name = Settings.Author.IsNullOrWhiteSpace() ? Environment.MachineName : Settings.Author,
|
Name = Settings.Author.IsNullOrWhiteSpace() ? _configFileProvider.InstanceName : Settings.Author,
|
||||||
IconUrl = "https://raw.githubusercontent.com/lidarr/Lidarr/develop/Logo/256.png"
|
IconUrl = "https://raw.githubusercontent.com/lidarr/Lidarr/develop/Logo/256.png"
|
||||||
},
|
},
|
||||||
Description = message.Message,
|
Description = message.Message,
|
||||||
|
@ -385,7 +388,7 @@ namespace NzbDrone.Core.Notifications.Discord
|
||||||
{
|
{
|
||||||
Author = new DiscordAuthor
|
Author = new DiscordAuthor
|
||||||
{
|
{
|
||||||
Name = Settings.Author.IsNullOrWhiteSpace() ? Environment.MachineName : Settings.Author,
|
Name = Settings.Author.IsNullOrWhiteSpace() ? _configFileProvider.InstanceName : Settings.Author,
|
||||||
IconUrl = "https://raw.githubusercontent.com/lidarr/Lidarr/develop/Logo/256.png"
|
IconUrl = "https://raw.githubusercontent.com/lidarr/Lidarr/develop/Logo/256.png"
|
||||||
},
|
},
|
||||||
Description = message.Message,
|
Description = message.Message,
|
||||||
|
@ -407,7 +410,7 @@ namespace NzbDrone.Core.Notifications.Discord
|
||||||
{
|
{
|
||||||
Author = new DiscordAuthor
|
Author = new DiscordAuthor
|
||||||
{
|
{
|
||||||
Name = Settings.Author.IsNullOrWhiteSpace() ? Environment.MachineName : Settings.Author,
|
Name = Settings.Author.IsNullOrWhiteSpace() ? _configFileProvider.InstanceName : Settings.Author,
|
||||||
IconUrl = "https://raw.githubusercontent.com/lidarr/Lidarr/develop/Logo/256.png"
|
IconUrl = "https://raw.githubusercontent.com/lidarr/Lidarr/develop/Logo/256.png"
|
||||||
},
|
},
|
||||||
Title = APPLICATION_UPDATE_TITLE,
|
Title = APPLICATION_UPDATE_TITLE,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue