mirror of
https://github.com/lidarr/lidarr.git
synced 2025-08-21 14:03:29 -07:00
ExternalNotifications, XBMC notification, building the framework for these, UI not implemented.
This commit is contained in:
parent
1314d00c97
commit
2af078b23d
12 changed files with 268 additions and 31 deletions
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
18
NzbDrone.Core/Helpers/ServerHelper.cs
Normal file
18
NzbDrone.Core/Helpers/ServerHelper.cs
Normal 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();
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue