mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-08-19 12:59:39 -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)
|
foreach (var r in requestedModels)
|
||||||
{
|
{
|
||||||
var releaseDate = r.ReleaseDate == DateTime.MinValue ? string.Empty : r.ReleaseDate.ToString("yyyy");
|
var releaseDate = r.ReleaseDate == DateTime.MinValue ? string.Empty : r.ReleaseDate.ToString("yyyy");
|
||||||
|
|
||||||
bool matchResult;
|
bool matchResult;
|
||||||
|
|
||||||
switch (r.Type)
|
switch (r.Type)
|
||||||
{
|
{
|
||||||
case RequestType.Movie:
|
case RequestType.Movie:
|
||||||
matchResult = IsMovieAvailable(movies, r.Title, releaseDate, r.ImdbId);
|
matchResult = IsMovieAvailable(movies, r.Title, releaseDate, r.ImdbId);
|
||||||
break;
|
break;
|
||||||
case RequestType.TvShow:
|
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;
|
break;
|
||||||
case RequestType.Album:
|
case RequestType.Album:
|
||||||
matchResult = IsAlbumAvailable(albums, r.Title, r.ReleaseDate.Year.ToString(), r.ArtistName);
|
matchResult = IsAlbumAvailable(albums, r.Title, r.ReleaseDate.Year.ToString(), r.ArtistName);
|
||||||
|
@ -126,6 +134,7 @@ namespace PlexRequests.Services.Jobs
|
||||||
throw new ArgumentOutOfRangeException();
|
throw new ArgumentOutOfRangeException();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (matchResult)
|
if (matchResult)
|
||||||
{
|
{
|
||||||
r.Available = true;
|
r.Available = true;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue