mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-07-31 12:00:06 -07:00
feat: updated emby availbility checker to check for 4k
This commit is contained in:
parent
9795cfe358
commit
503b80a2a5
1 changed files with 14 additions and 3 deletions
|
@ -53,10 +53,11 @@ namespace Ombi.Schedule.Jobs.Emby
|
||||||
|
|
||||||
private async Task ProcessMovies()
|
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)
|
foreach (var movie in movies)
|
||||||
{
|
{
|
||||||
|
var has4kRequest = movie.Has4KRequest;
|
||||||
EmbyContent embyContent = null;
|
EmbyContent embyContent = null;
|
||||||
if (movie.TheMovieDbId > 0)
|
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);
|
_log.LogInformation("We have found the request {0} on Emby, sending the notification", movie?.Title ?? string.Empty);
|
||||||
|
|
||||||
movie.Available = true;
|
if (has4kRequest && embyContent.Has4K)
|
||||||
movie.MarkedAsAvailable = DateTime.Now;
|
{
|
||||||
|
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)
|
if (movie.Available)
|
||||||
{
|
{
|
||||||
var recipient = movie.RequestedUser.Email.HasValue() ? movie.RequestedUser.Email : string.Empty;
|
var recipient = movie.RequestedUser.Email.HasValue() ? movie.RequestedUser.Email : string.Empty;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue