ExternalNotifications, XBMC notification, building the framework for these, UI not implemented.

This commit is contained in:
markus101 2011-03-06 12:45:35 -08:00
commit 2af078b23d
12 changed files with 268 additions and 31 deletions

View file

@ -33,5 +33,27 @@ namespace NzbDrone.Core.Helpers
{
return seasonFolderFormat.Replace("%s", seasonNumber.ToString()).Replace("%0s", seasonNumber.ToString("00"));
}
public static string GetNameForNotify(EpisodeRenameModel erm)
{
if (erm.EpisodeFile.Episodes.Count == 1)
{
return String.Format("{0} - S{1:00}E{2:00} - {3}", erm.SeriesName,
erm.EpisodeFile.Episodes[0].SeasonNumber, erm.EpisodeFile.Episodes[0].EpisodeNumber,
erm.EpisodeFile.Episodes[0].Title);
}
var epNumberString = String.Empty;
var epNameString = String.Empty;
foreach (var episode in erm.EpisodeFile.Episodes)
{
epNumberString = epNumberString + String.Format("E{0:00}", episode.EpisodeNumber);
epNameString = epNameString + String.Format("+ {0}", episode.Title).Trim(' ', '+');
}
return String.Format("{0} - S{1:00}E{2} - {3}", erm.SeriesName, erm.EpisodeFile.Episodes[0].SeasonNumber,
epNumberString, epNameString);
}
}
}

View file

@ -0,0 +1,18 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Text;
namespace NzbDrone.Core.Helpers
{
public static class ServerHelper
{
public static string GetServerHostname()
{
//Both these seem to return the same result... Is on better than the other?
return Environment.MachineName;
//return Dns.GetHostName();
}
}
}