mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-08-14 02:26:55 -07:00
Added Tv watchlist import
This commit is contained in:
parent
268e31c019
commit
0329c2b9d9
7 changed files with 185 additions and 20 deletions
|
@ -188,7 +188,7 @@ namespace Ombi.Core.Engine
|
|||
(await tvBuilder
|
||||
.GetShowInfo(tv.TheMovieDbId, tv.languageCode))
|
||||
.CreateTvList(tv)
|
||||
.CreateChild(tv, canRequestOnBehalf ? tv.RequestOnBehalf : user.Id);
|
||||
.CreateChild(tv, canRequestOnBehalf ? tv.RequestOnBehalf : user.Id, tv.Source);
|
||||
|
||||
await tvBuilder.BuildEpisodes(tv);
|
||||
|
||||
|
|
|
@ -53,7 +53,7 @@ namespace Ombi.Core.Helpers
|
|||
return this;
|
||||
}
|
||||
|
||||
public TvShowRequestBuilderV2 CreateChild(TvRequestViewModelV2 model, string userId)
|
||||
public TvShowRequestBuilderV2 CreateChild(TvRequestViewModelV2 model, string userId, RequestSource source)
|
||||
{
|
||||
var animationGenre = TheMovieDbRecord.genres?.Any(s => s.name.Equals("Animation", StringComparison.InvariantCultureIgnoreCase)) ?? false;
|
||||
var animeKeyword = TheMovieDbRecord.Keywords?.KeywordsValue?.Any(s => s.Name.Equals("Anime", StringComparison.InvariantCultureIgnoreCase)) ?? false;
|
||||
|
@ -68,7 +68,8 @@ namespace Ombi.Core.Helpers
|
|||
Title = TheMovieDbRecord.name,
|
||||
ReleaseYear = FirstAir,
|
||||
RequestedByAlias = model.RequestedByAlias,
|
||||
SeriesType = animationGenre && animeKeyword ? SeriesType.Anime : SeriesType.Standard
|
||||
SeriesType = animationGenre && animeKeyword ? SeriesType.Anime : SeriesType.Standard,
|
||||
Source = source
|
||||
};
|
||||
|
||||
return this;
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
using System.Collections.Generic;
|
||||
using Newtonsoft.Json;
|
||||
using Ombi.Store.Entities.Requests;
|
||||
|
||||
namespace Ombi.Core.Models.Requests
|
||||
{
|
||||
|
@ -7,5 +8,6 @@ namespace Ombi.Core.Models.Requests
|
|||
{
|
||||
public int TheMovieDbId { get; set; }
|
||||
public string languageCode { get; set; } = "en";
|
||||
public RequestSource Source { get; set; } = RequestSource.Ombi;
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue