1
0
mirror of https://github.com/Sonarr/Sonarr.git synced 2024-12-16 11:37:58 +02:00

Fixed: Notifications won't show version unless its anime, will show proper

This commit is contained in:
Mark McDowall 2014-09-23 10:56:15 -07:00
parent fdf210d10f
commit adf0fc8990
2 changed files with 26 additions and 10 deletions

View File

@ -26,6 +26,21 @@ public NotificationService(INotificationFactory notificationFactory, Logger logg
private string GetMessage(Series series, List<Episode> episodes, QualityModel quality) private string GetMessage(Series series, List<Episode> episodes, QualityModel quality)
{ {
var qualityString = quality.Quality.ToString();
if (quality.Revision.Version > 0)
{
if (series.SeriesType == SeriesTypes.Anime)
{
qualityString += " v" + quality.Revision.Version;
}
else
{
qualityString += " Proper";
}
}
if (series.SeriesType == SeriesTypes.Daily) if (series.SeriesType == SeriesTypes.Daily)
{ {
var episode = episodes.First(); var episode = episodes.First();
@ -34,7 +49,7 @@ private string GetMessage(Series series, List<Episode> episodes, QualityModel qu
series.Title, series.Title,
episode.AirDate, episode.AirDate,
episode.Title, episode.Title,
quality); qualityString);
} }
var episodeNumbers = String.Concat(episodes.Select(e => e.EpisodeNumber) var episodeNumbers = String.Concat(episodes.Select(e => e.EpisodeNumber)
@ -47,7 +62,7 @@ private string GetMessage(Series series, List<Episode> episodes, QualityModel qu
episodes.First().SeasonNumber, episodes.First().SeasonNumber,
episodeNumbers, episodeNumbers,
episodeTitles, episodeTitles,
quality); qualityString);
} }
public void Handle(EpisodeGrabbedEvent message) public void Handle(EpisodeGrabbedEvent message)

View File

@ -38,6 +38,7 @@ public int CompareTo(Revision other)
public override string ToString() public override string ToString()
{ {
var sb = new StringBuilder(); var sb = new StringBuilder();
sb.AppendFormat("v{0}", Version); sb.AppendFormat("v{0}", Version);
if (Real > 0) if (Real > 0)
@ -73,32 +74,32 @@ public override bool Equals(object obj)
public static bool operator >(Revision left, Revision right) public static bool operator >(Revision left, Revision right)
{ {
if (left == null) return false; if (ReferenceEquals(null, left)) return false;
if (right == null) return true; if (ReferenceEquals(null, right)) return true;
return left.CompareTo(right) > 0; return left.CompareTo(right) > 0;
} }
public static bool operator <(Revision left, Revision right) public static bool operator <(Revision left, Revision right)
{ {
if (left == null) return true; if (ReferenceEquals(null, left)) return true;
if (right == null) return false; if (ReferenceEquals(null, right)) return false;
return left.CompareTo(right) < 0; return left.CompareTo(right) < 0;
} }
public static bool operator >=(Revision left, Revision right) public static bool operator >=(Revision left, Revision right)
{ {
if (left == null) return false; if (ReferenceEquals(null, left)) return false;
if (right == null) return true; if (ReferenceEquals(null, right)) return true;
return left.CompareTo(right) >= 0; return left.CompareTo(right) >= 0;
} }
public static bool operator <=(Revision left, Revision right) public static bool operator <=(Revision left, Revision right)
{ {
if (left == null) return true; if (ReferenceEquals(null, left)) return true;
if (right == null) return false; if (ReferenceEquals(null, right)) return false;
return left.CompareTo(right) <= 0; return left.CompareTo(right) <= 0;
} }