Use originallyAvailableAt to populate Aired property

This commit is contained in:
Adam Worley 2020-10-06 21:54:32 +01:00
commit 310c5c6f38
8 changed files with 16 additions and 6 deletions

View file

@ -19,7 +19,7 @@ namespace Ombi.Api.Plex.Models
public string banner { get; set; } public string banner { get; set; }
public string theme { get; set; } public string theme { get; set; }
//public string duration { get; set; } //public string duration { get; set; }
//public string originallyAvailableAt { get; set; } public string originallyAvailableAt { get; set; }
public int leafCount { get; set; } public int leafCount { get; set; }
public int viewedLeafCount { get; set; } public int viewedLeafCount { get; set; }
public int childCount { get; set; } public int childCount { get; set; }

View file

@ -93,7 +93,8 @@ namespace Ombi.Core.Engine
ContentId = int.Parse(ep.Series.TvDbId), ContentId = int.Parse(ep.Series.TvDbId),
ContentType = ContentType.Episode, ContentType = ContentType.Episode,
EpisodeNumber = ep.EpisodeNumber, EpisodeNumber = ep.EpisodeNumber,
SeasonNumber = ep.SeasonNumber SeasonNumber = ep.SeasonNumber,
Aired = ep.Aired
}); });
} }
} }
@ -131,7 +132,8 @@ namespace Ombi.Core.Engine
ContentId = int.Parse(ep.Series.TvDbId), ContentId = int.Parse(ep.Series.TvDbId),
ContentType = ContentType.Episode, ContentType = ContentType.Episode,
EpisodeNumber = ep.EpisodeNumber, EpisodeNumber = ep.EpisodeNumber,
SeasonNumber = ep.SeasonNumber SeasonNumber = ep.SeasonNumber,
Aired = ep.Aired
}); });
} }
} }
@ -217,7 +219,8 @@ namespace Ombi.Core.Engine
ReleaseYear = plex.ReleaseYear, ReleaseYear = plex.ReleaseYear,
TvDbId = plex.TvDbId, TvDbId = plex.TvDbId,
EpisodeNumber = episode.EpisodeNumber, EpisodeNumber = episode.EpisodeNumber,
SeasonNumber = season.SeasonNumber SeasonNumber = season.SeasonNumber,
Aired = plex.Aired
}); });
} }
} }

View file

@ -15,5 +15,6 @@ namespace Ombi.Core.Models
public string Quality { get; set; } public string Quality { get; set; }
public int SeasonNumber { get; set; } public int SeasonNumber { get; set; }
public int EpisodeNumber { get; set; } public int EpisodeNumber { get; set; }
public DateTime Aired { get; set; }
} }
} }

View file

@ -186,7 +186,8 @@ namespace Ombi.Schedule.Jobs.Plex
GrandparentKey = episode.grandparentRatingKey, GrandparentKey = episode.grandparentRatingKey,
ParentKey = episode.parentRatingKey, ParentKey = episode.parentRatingKey,
Key = episode.ratingKey, Key = episode.ratingKey,
Title = episode.title Title = episode.title,
Aired = DateTime.TryParse(episode.originallyAvailableAt, out var parseDate) ? parseDate : (DateTime?)null,
}); });
} }

View file

@ -49,5 +49,6 @@ namespace Ombi.Store.Entities
public string TheMovieDbId { get; set; } public string TheMovieDbId { get; set; }
public EmbyContent Series { get; set; } public EmbyContent Series { get; set; }
public DateTime Aired { get; set; }
} }
} }

View file

@ -1,4 +1,5 @@
using System.ComponentModel.DataAnnotations.Schema; using System;
using System.ComponentModel.DataAnnotations.Schema;
namespace Ombi.Store.Entities namespace Ombi.Store.Entities
{ {
@ -26,5 +27,6 @@ namespace Ombi.Store.Entities
public PlexServerContent Series { get; set; } public PlexServerContent Series { get; set; }
public DateTime? Aired { get; set; }
} }
} }

View file

@ -54,6 +54,7 @@ namespace Ombi.Store.Entities
public string Quality { get; set; } public string Quality { get; set; }
public int? RequestId { get; set; } public int? RequestId { get; set; }
public DateTime Aired { get; set; }
[NotMapped] [NotMapped]
public bool HasImdb => !string.IsNullOrEmpty(ImdbId); public bool HasImdb => !string.IsNullOrEmpty(ImdbId);

View file

@ -13,6 +13,7 @@ namespace Ombi.Store.Entities
public int? SeasonNumber { get; set; } public int? SeasonNumber { get; set; }
public string AlbumId { get; set; } public string AlbumId { get; set; }
public DateTime AddedAt { get; set; } public DateTime AddedAt { get; set; }
public DateTime? Aired { get; set; }
} }
public enum RecentlyAddedType public enum RecentlyAddedType