diff --git a/NzbDrone.Core/Helpers/SabnzbdQueueTimeConverter.cs b/NzbDrone.Core/Helpers/SabnzbdQueueTimeConverter.cs index 61e70bc03..21fd740c9 100644 --- a/NzbDrone.Core/Helpers/SabnzbdQueueTimeConverter.cs +++ b/NzbDrone.Core/Helpers/SabnzbdQueueTimeConverter.cs @@ -10,34 +10,28 @@ public class SabnzbdQueueTimeConverter : JsonConverter { public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) { - if (value is TimeSpan) - writer.WriteValue(value.ToString()); - - else - throw new Exception("Expected TimeSpan object value."); + var ts = (TimeSpan)value; + writer.WriteValue(ts.ToString()); } public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer) { var split = reader.Value.ToString().Split(':'); - if (split.Count() == 3) + if (split.Count() != 3) { - return new TimeSpan(int.Parse(split[0]), // hours + throw new ArgumentException("TimeSpan is invalid"); + } + + return new TimeSpan(int.Parse(split[0]), // hours int.Parse(split[1]), // minutes int.Parse(split[2]) // seconds ); - } - - throw new ArgumentException("TimeSpan is invalid"); } public override bool CanConvert(Type objectType) { - if (objectType == typeof(TimeSpan)) - return true; - - return false; + return objectType == typeof(TimeSpan); } } } diff --git a/NzbDrone.Core/Model/EpisodeParseResult.cs b/NzbDrone.Core/Model/EpisodeParseResult.cs index 4b9d73eb8..820f5bb98 100644 --- a/NzbDrone.Core/Model/EpisodeParseResult.cs +++ b/NzbDrone.Core/Model/EpisodeParseResult.cs @@ -44,6 +44,9 @@ public override string ToString() if (AirDate != null && EpisodeNumbers == null) return string.Format("{0} - {1} {2}", SeriesTitle, AirDate.Value.ToShortDateString(), Quality); + if (FullSeason) + return string.Format("{0} - Season {1:00}", SeriesTitle, SeasonNumber); + if (EpisodeNumbers != null) return string.Format("{0} - S{1:00}E{2} {3}", SeriesTitle, SeasonNumber, String.Join("-", EpisodeNumbers), Quality);