mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-08-14 02:26:55 -07:00
Update the availability checker to search for TV Episodes
This commit is contained in:
parent
4cc698a833
commit
87f343ef06
1 changed files with 11 additions and 2 deletions
|
@ -109,15 +109,23 @@ namespace PlexRequests.Services.Jobs
|
|||
foreach (var r in requestedModels)
|
||||
{
|
||||
var releaseDate = r.ReleaseDate == DateTime.MinValue ? string.Empty : r.ReleaseDate.ToString("yyyy");
|
||||
|
||||
bool matchResult;
|
||||
|
||||
switch (r.Type)
|
||||
{
|
||||
case RequestType.Movie:
|
||||
matchResult = IsMovieAvailable(movies, r.Title, releaseDate, r.ImdbId);
|
||||
break;
|
||||
case RequestType.TvShow:
|
||||
matchResult = IsTvShowAvailable(shows, r.Title, releaseDate, r.TvDbId);
|
||||
if (!plexSettings.EnableTvEpisodeSearching)
|
||||
{
|
||||
matchResult = IsTvShowAvailable(shows, r.Title, releaseDate, r.TvDbId);
|
||||
}
|
||||
else
|
||||
{
|
||||
matchResult =
|
||||
r.Episodes.All(x => IsEpisodeAvailable(r.TvDbId, x.SeasonNumber, x.EpisodeNumber));
|
||||
}
|
||||
break;
|
||||
case RequestType.Album:
|
||||
matchResult = IsAlbumAvailable(albums, r.Title, r.ReleaseDate.Year.ToString(), r.ArtistName);
|
||||
|
@ -126,6 +134,7 @@ namespace PlexRequests.Services.Jobs
|
|||
throw new ArgumentOutOfRangeException();
|
||||
}
|
||||
|
||||
|
||||
if (matchResult)
|
||||
{
|
||||
r.Available = true;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue