mirror of
https://github.com/Sonarr/Sonarr
synced 2024-12-30 19:56:54 +00:00
Readded Growl logo via embedded binary blob.
This commit is contained in:
parent
a62cd042de
commit
d1a8cd2a84
4 changed files with 43 additions and 14 deletions
|
@ -138,6 +138,7 @@
|
|||
<Compile Include="Properties\SharedAssemblyInfo.cs" />
|
||||
<Compile Include="RateGate.cs" />
|
||||
<Compile Include="Reflection\ReflectionExtensions.cs" />
|
||||
<Compile Include="ResourceExtensions.cs" />
|
||||
<Compile Include="Security\IgnoreCertErrorPolicy.cs" />
|
||||
<Compile Include="Serializer\IntConverter.cs" />
|
||||
<Compile Include="Serializer\Json.cs" />
|
||||
|
|
28
src/NzbDrone.Common/ResourceExtensions.cs
Normal file
28
src/NzbDrone.Common/ResourceExtensions.cs
Normal file
|
@ -0,0 +1,28 @@
|
|||
using NzbDrone.Common.EnsureThat;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using System.Text;
|
||||
|
||||
namespace NzbDrone.Common
|
||||
{
|
||||
public static class ResourceExtensions
|
||||
{
|
||||
public static Byte[] GetManifestResourceBytes(this Assembly assembly, String name)
|
||||
{
|
||||
var stream = assembly.GetManifestResourceStream(name);
|
||||
|
||||
var result = new Byte[stream.Length];
|
||||
var read = stream.Read(result, 0, result.Length);
|
||||
|
||||
if (read != result.Length)
|
||||
{
|
||||
throw new EndOfStreamException("Reached end of stream before reading enough bytes.");
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,13 +1,14 @@
|
|||
using System;
|
||||
using FluentValidation.Results;
|
||||
using Growl.Connector;
|
||||
using Growl.CoreLibrary;
|
||||
using GrowlNotification = Growl.Connector.Notification;
|
||||
using NLog;
|
||||
using NzbDrone.Common;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Threading;
|
||||
using FluentValidation.Results;
|
||||
using Growl.CoreLibrary;
|
||||
using Growl.Connector;
|
||||
using NLog;
|
||||
using GrowlNotification = Growl.Connector.Notification;
|
||||
using System.IO;
|
||||
|
||||
namespace NzbDrone.Core.Notifications.Growl
|
||||
{
|
||||
|
@ -72,9 +73,9 @@ namespace NzbDrone.Core.Notifications.Growl
|
|||
_logger = logger;
|
||||
_notificationTypes = GetNotificationTypes();
|
||||
|
||||
// var bytes = File.ReadAllBytes("64.png");
|
||||
//
|
||||
// _growlApplication.Icon = new BinaryData(bytes);
|
||||
var logo = typeof(GrowlService).Assembly.GetManifestResourceBytes("NzbDrone.Core.Resources.Logo.64.png");
|
||||
|
||||
_growlApplication.Icon = new BinaryData(logo);
|
||||
}
|
||||
|
||||
private GrowlConnector GetGrowlConnector(string hostname, int port, string password)
|
||||
|
|
|
@ -794,10 +794,9 @@
|
|||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="..\..\Logo\64.png">
|
||||
<Link>64.png</Link>
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<EmbeddedResource Include="..\..\Logo\64.png">
|
||||
<Link>Resources\Logo\64.png</Link>
|
||||
</EmbeddedResource>
|
||||
<Content Include="MediaInfo.dll">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</Content>
|
||||
|
|
Loading…
Reference in a new issue