add an extra check when determining if a tv show is already available (also check if it starts with the show name returned from the tv db)

This commit is contained in:
Drewster727 2016-04-14 23:13:32 -05:00
parent 4c6c0ae900
commit 1fbe29af10

View file

@ -199,7 +199,9 @@ namespace PlexRequests.Services
public bool IsTvShowAvailable(PlexTvShow[] plexShows, string title, string year) public bool IsTvShowAvailable(PlexTvShow[] plexShows, string title, string year)
{ {
return plexShows.Any(x => x.Title.Equals(title, StringComparison.CurrentCultureIgnoreCase) && x.ReleaseYear.Equals(year, StringComparison.CurrentCultureIgnoreCase)); return plexShows.Any(x =>
(x.Title.Equals(title, StringComparison.CurrentCultureIgnoreCase) || x.Title.StartsWith(title, StringComparison.CurrentCultureIgnoreCase)) &&
x.ReleaseYear.Equals(year, StringComparison.CurrentCultureIgnoreCase));
} }
public List<PlexAlbum> GetPlexAlbums() public List<PlexAlbum> GetPlexAlbums()