|
|
@ -3,12 +3,10 @@ using System.Collections.Generic;
|
|
|
|
using System.Linq;
|
|
|
|
using System.Linq;
|
|
|
|
using System.Security.Principal;
|
|
|
|
using System.Security.Principal;
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
using Ombi.Api.Sonarr.Models;
|
|
|
|
|
|
|
|
using Ombi.Core.Authentication;
|
|
|
|
using Ombi.Core.Authentication;
|
|
|
|
using Ombi.Core.Engine.Interfaces;
|
|
|
|
using Ombi.Core.Engine.Interfaces;
|
|
|
|
using Ombi.Core.Models.Search.V2;
|
|
|
|
using Ombi.Core.Models.Search.V2;
|
|
|
|
using Ombi.Core.Rule.Interfaces;
|
|
|
|
using Ombi.Core.Rule.Interfaces;
|
|
|
|
using Ombi.Helpers;
|
|
|
|
|
|
|
|
using Ombi.Store.Entities;
|
|
|
|
using Ombi.Store.Entities;
|
|
|
|
using Ombi.Store.Entities.Requests;
|
|
|
|
using Ombi.Store.Entities.Requests;
|
|
|
|
using Ombi.Store.Repository.Requests;
|
|
|
|
using Ombi.Store.Repository.Requests;
|
|
|
@ -46,27 +44,41 @@ namespace Ombi.Core.Engine.V2
|
|
|
|
BackgroundColor = GetBackgroundColor(e),
|
|
|
|
BackgroundColor = GetBackgroundColor(e),
|
|
|
|
ExtraParams = new List<ExtraParams>
|
|
|
|
ExtraParams = new List<ExtraParams>
|
|
|
|
{
|
|
|
|
{
|
|
|
|
new ExtraParams { Overview = e.Season?.ChildRequest?.ParentRequest?.Overview ?? string.Empty, ProviderId = e.Season?.ChildRequest?.ParentRequest?.TvDbId ?? 0}
|
|
|
|
new ExtraParams
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
Overview = e.Season?.ChildRequest?.ParentRequest?.Overview ?? string.Empty,
|
|
|
|
|
|
|
|
ProviderId = e.Season?.ChildRequest?.ParentRequest?.TvDbId ?? 0,
|
|
|
|
|
|
|
|
Type = RequestType.TvShow,
|
|
|
|
|
|
|
|
ReleaseDate = e.AirDate,
|
|
|
|
|
|
|
|
RequestStatus = e.RequestStatus
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
foreach (var m in movies)
|
|
|
|
foreach (var m in movies)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
viewModel.Add(new CalendarViewModel
|
|
|
|
viewModel.Add(new CalendarViewModel
|
|
|
|
{
|
|
|
|
{
|
|
|
|
Title = m.Title,
|
|
|
|
Title = m.Title,
|
|
|
|
Start = m.ReleaseDate.Date,
|
|
|
|
Start = m.ReleaseDate.Date,
|
|
|
|
BackgroundColor = GetBackgroundColor(m),
|
|
|
|
BackgroundColor = GetBackgroundColor(m),
|
|
|
|
Type = RequestType.Movie,
|
|
|
|
Type = RequestType.Movie,
|
|
|
|
ExtraParams = new List<ExtraParams>
|
|
|
|
ExtraParams = new List<ExtraParams>
|
|
|
|
{
|
|
|
|
{
|
|
|
|
new ExtraParams { Overview = m.Overview, ProviderId = m.TheMovieDbId}
|
|
|
|
new ExtraParams
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
Overview = m.Overview,
|
|
|
|
|
|
|
|
ProviderId = m.TheMovieDbId,
|
|
|
|
|
|
|
|
Type = RequestType.Movie,
|
|
|
|
|
|
|
|
ReleaseDate = m.ReleaseDate,
|
|
|
|
|
|
|
|
RequestStatus = m.RequestStatus
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return viewModel;
|
|
|
|
return viewModel;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private string GetBackgroundColor(BaseRequest req)
|
|
|
|
private string GetBackgroundColor(BaseRequest req)
|
|
|
|