added ContainsEpisodeNumber helper on Episode

This commit is contained in:
Luke Pulverenti 2013-10-15 18:16:26 -04:00
parent ca2e0f3451
commit dc986db8cc

View File

@ -171,5 +171,25 @@ namespace MediaBrowser.Controller.Entities.TV
return (ParentIndexNumber != null ? ParentIndexNumber.Value.ToString("000-") : "")
+ (IndexNumber != null ? IndexNumber.Value.ToString("0000 - ") : "") + Name;
}
/// <summary>
/// Determines whether [contains episode number] [the specified number].
/// </summary>
/// <param name="number">The number.</param>
/// <returns><c>true</c> if [contains episode number] [the specified number]; otherwise, <c>false</c>.</returns>
public bool ContainsEpisodeNumber(int number)
{
if (IndexNumber.HasValue)
{
if (IndexNumberEnd.HasValue)
{
return number >= IndexNumber.Value && number <= IndexNumberEnd.Value;
}
return IndexNumber.Value == number;
}
return false;
}
}
}