diff --git a/MediaBrowser.Controller/Entities/TV/Episode.cs b/MediaBrowser.Controller/Entities/TV/Episode.cs
index c6c426a680..14c6554556 100644
--- a/MediaBrowser.Controller/Entities/TV/Episode.cs
+++ b/MediaBrowser.Controller/Entities/TV/Episode.cs
@@ -171,5 +171,25 @@ namespace MediaBrowser.Controller.Entities.TV
return (ParentIndexNumber != null ? ParentIndexNumber.Value.ToString("000-") : "")
+ (IndexNumber != null ? IndexNumber.Value.ToString("0000 - ") : "") + Name;
}
+
+ ///
+ /// Determines whether [contains episode number] [the specified number].
+ ///
+ /// The number.
+ /// true if [contains episode number] [the specified number]; otherwise, false.
+ public bool ContainsEpisodeNumber(int number)
+ {
+ if (IndexNumber.HasValue)
+ {
+ if (IndexNumberEnd.HasValue)
+ {
+ return number >= IndexNumber.Value && number <= IndexNumberEnd.Value;
+ }
+
+ return IndexNumber.Value == number;
+ }
+
+ return false;
+ }
}
}