mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-03-12 04:35:27 -07:00
feat: updated emby availbility checker to check for 4k
This commit is contained in:
parent
9795cfe358
commit
503b80a2a5
@ -53,10 +53,11 @@ namespace Ombi.Schedule.Jobs.Emby
|
||||
|
||||
private async Task ProcessMovies()
|
||||
{
|
||||
var movies = _movieRepo.GetAll().Include(x => x.RequestedUser).Where(x => !x.Available);
|
||||
var movies = _movieRepo.GetAll().Include(x => x.RequestedUser).Where(x => !x.Available || (!x.Available4K && x.Has4KRequest));
|
||||
|
||||
foreach (var movie in movies)
|
||||
{
|
||||
var has4kRequest = movie.Has4KRequest;
|
||||
EmbyContent embyContent = null;
|
||||
if (movie.TheMovieDbId > 0)
|
||||
{
|
||||
@ -75,8 +76,18 @@ namespace Ombi.Schedule.Jobs.Emby
|
||||
|
||||
_log.LogInformation("We have found the request {0} on Emby, sending the notification", movie?.Title ?? string.Empty);
|
||||
|
||||
movie.Available = true;
|
||||
movie.MarkedAsAvailable = DateTime.Now;
|
||||
if (has4kRequest && embyContent.Has4K)
|
||||
{
|
||||
movie.Available4K = true;
|
||||
movie.MarkedAsAvailable4K = DateTime.Now;
|
||||
}
|
||||
|
||||
// If we have a non-4k versison then mark as available
|
||||
if (embyContent.Quality.HasValue())
|
||||
{
|
||||
movie.Available = true;
|
||||
movie.MarkedAsAvailable = DateTime.Now;
|
||||
}
|
||||
if (movie.Available)
|
||||
{
|
||||
var recipient = movie.RequestedUser.Email.HasValue() ? movie.RequestedUser.Email : string.Empty;
|
||||
|
Loading…
x
Reference in New Issue
Block a user