Fixed XBMC notification image

This commit is contained in:
Mark McDowall 2013-08-12 20:12:49 -07:00
parent 47197b802c
commit 4a9e2894ef
5 changed files with 2 additions and 61 deletions

BIN
Logo/64.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

View File

@ -23,7 +23,7 @@ namespace NzbDrone.Core.Notifications.Xbmc
public void Notify(XbmcSettings settings, string title, string message) public void Notify(XbmcSettings settings, string title, string message)
{ {
var notification = String.Format("Notification({0},{1},{2},{3})", title, message, settings.DisplayTime * 1000, "https://raw.github.com/NzbDrone/NzbDrone/vnext/NzbDrone.Core/NzbDrone.jpg"); var notification = String.Format("Notification({0},{1},{2},{3})", title, message, settings.DisplayTime * 1000, "https://raw.github.com/NzbDrone/NzbDrone/develop/Logo/64.png");
var command = BuildExecBuiltInCommand(notification); var command = BuildExecBuiltInCommand(notification);
SendCommand(settings, command); SendCommand(settings, command);

View File

@ -26,7 +26,7 @@ namespace NzbDrone.Core.Notifications.Xbmc
var parameters = new JObject( var parameters = new JObject(
new JProperty("title", title), new JProperty("title", title),
new JProperty("message", message), new JProperty("message", message),
new JProperty("image", "https://raw.github.com/NzbDrone/NzbDrone/vnext/NzbDrone.Core/NzbDrone.jpg"), new JProperty("image", "https://raw.github.com/NzbDrone/NzbDrone/develop/Logo/64.png"),
new JProperty("displaytime", settings.DisplayTime * 1000)); new JProperty("displaytime", settings.DisplayTime * 1000));
var postJson = BuildJsonRequest("GUI.ShowNotification", parameters); var postJson = BuildJsonRequest("GUI.ShowNotification", parameters);

View File

@ -1,58 +0,0 @@
using System.Drawing;
using System.IO;
namespace NzbDrone.Core.Notifications.Xbmc
{
public class ResourceManager
{
public static Icon GetIcon(string Name)
{
Stream stm = typeof(ResourceManager).Assembly.GetManifestResourceStream(string.Format("NzbDrone.Core.{0}.ico", Name));
if (stm == null) return null;
return new Icon(stm);
}
public static byte[] GetRawData(string Name)
{
byte[] data;
using (Stream stm = typeof(ResourceManager).Assembly.GetManifestResourceStream(string.Format("NzbDrone.Core.{0}.ico", Name)))
{
if (stm == null) return null;
data = new byte[stm.Length];
stm.Read(data, 0, data.Length);
}
return data;
}
public static byte[] GetRawLogo(string Name)
{
byte[] data;
using (Stream stm = typeof(ResourceManager).Assembly.GetManifestResourceStream(string.Format("NzbDrone.Core.{0}", Name)))
{
if (stm == null) return null;
data = new byte[stm.Length];
stm.Read(data, 0, data.Length);
}
return data;
}
public static Bitmap GetIconAsImage(string Name)
{
Stream stm = typeof(ResourceManager).Assembly.GetManifestResourceStream(string.Format("NzbDrone.Core.{0}.ico", Name));
if (stm == null) return null;
Bitmap bmp;
using (Icon ico = new Icon(stm))
{
bmp = new Bitmap(ico.Width, ico.Height);
using (Graphics g = Graphics.FromImage(bmp))
{
g.DrawIcon(ico, 0, 0);
}
}
return bmp;
}
}
}

View File

@ -541,7 +541,6 @@
<Content Include="MediaInfo.dll"> <Content Include="MediaInfo.dll">
<CopyToOutputDirectory>Always</CopyToOutputDirectory> <CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content> </Content>
<Content Include="NzbDrone.ico" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Folder Include="Download\Clients\Sabnzbd\Api\" /> <Folder Include="Download\Clients\Sabnzbd\Api\" />