Done the migration for the external db !wip

This commit is contained in:
TidusJar 2018-10-04 15:05:43 +01:00
parent 26da9d242c
commit ca48361865
15 changed files with 112 additions and 53 deletions

View file

@ -12,12 +12,12 @@ namespace Ombi.Store.Context
public interface IOmbiContext : IDbContext
{
DbSet<PlexServerContent> PlexServerContent { get; set; }
DbSet<PlexEpisode> PlexEpisode { get; set; }
//DbSet<PlexServerContent> PlexServerContent { get; set; }
//DbSet<PlexEpisode> PlexEpisode { get; set; }
DbSet<GlobalSettings> Settings { get; set; }
DbSet<RadarrCache> RadarrCache { get; set; }
DbSet<EmbyContent> EmbyContent { get; set; }
DbSet<EmbyEpisode> EmbyEpisode { get; set; }
//DbSet<RadarrCache> RadarrCache { get; set; }
//DbSet<EmbyContent> EmbyContent { get; set; }
//DbSet<EmbyEpisode> EmbyEpisode { get; set; }
DbSet<NotificationTemplates> NotificationTemplates { get; set; }
DbSet<ApplicationConfiguration> ApplicationConfigurations { get; set; }
DbSet<Audit> Audit { get; set; }
@ -29,12 +29,12 @@ namespace Ombi.Store.Context
DbSet<IssueCategory> IssueCategories { get; set; }
DbSet<Tokens> Tokens { get; set; }
DbSet<SonarrCache> SonarrCache { get; set; }
DbSet<SonarrEpisodeCache> SonarrEpisodeCache { get; set; }
DbSet<CouchPotatoCache> CouchPotatoCache { get; set; }
DbSet<SickRageCache> SickRageCache { get; set; }
DbSet<LidarrArtistCache> LidarrArtistCache { get; set; }
DbSet<LidarrAlbumCache> LidarrAlbumCache { get; set; }
DbSet<SickRageEpisodeCache> SickRageEpisodeCache { get; set; }
//DbSet<SonarrEpisodeCache> SonarrEpisodeCache { get; set; }
//DbSet<CouchPotatoCache> CouchPotatoCache { get; set; }
//DbSet<SickRageCache> SickRageCache { get; set; }
//DbSet<LidarrArtistCache> LidarrArtistCache { get; set; }
//DbSet<LidarrAlbumCache> LidarrAlbumCache { get; set; }
//DbSet<SickRageEpisodeCache> SickRageEpisodeCache { get; set; }
DbSet<RequestLog> RequestLogs { get; set; }
DbSet<RecentlyAddedLog> RecentlyAddedLogs { get; set; }
DbSet<RequestSubscription> RequestSubscription { get; set; }

View file

@ -42,11 +42,6 @@ namespace Ombi.Store.Entities
public PlexMediaTypeEntity Type { get; set; }
public string Url { get; set; }
/// <summary>
/// Only used for TV Shows
/// </summary>
public virtual ICollection<PlexSeasonsContent> Seasons { get; set; }
public ICollection<PlexEpisode> Episodes { get; set; }
@ -67,15 +62,6 @@ namespace Ombi.Store.Entities
public bool HasTheMovieDb => !string.IsNullOrEmpty(TheMovieDbId);
}
[Table("PlexSeasonsContent")]
public class PlexSeasonsContent : Entity
{
public int PlexContentId { get; set; }
public int SeasonNumber { get; set; }
public int SeasonKey { get; set; }
public int ParentKey { get; set; }
}
public enum PlexMediaTypeEntity
{
Movie = 0,

View file

@ -35,15 +35,15 @@ using Ombi.Store.Entities;
namespace Ombi.Store.Repository
{
public class EmbyContentRepository : Repository<EmbyContent>, IEmbyContentRepository
public class EmbyContentRepository : ExternalRepository<EmbyContent>, IEmbyContentRepository
{
public EmbyContentRepository(IOmbiContext db):base(db)
public EmbyContentRepository(IExternalContext db):base(db)
{
Db = db;
}
private IOmbiContext Db { get; }
private IExternalContext Db { get; }
public async Task<EmbyContent> GetByImdbId(string imdbid)

View file

@ -7,7 +7,7 @@ using Ombi.Store.Entities;
namespace Ombi.Store.Repository
{
public interface IPlexContentRepository : IRepository<PlexServerContent>
public interface IPlexContentRepository : IExternalRepository<PlexServerContent>
{
Task<bool> ContentExists(string providerId);
Task<PlexServerContent> Get(string providerId);

View file

@ -36,15 +36,15 @@ using Ombi.Store.Entities;
namespace Ombi.Store.Repository
{
public class PlexServerContentRepository : Repository<PlexServerContent>, IPlexContentRepository
public class PlexServerContentRepository : ExternalRepository<PlexServerContent>, IPlexContentRepository
{
public PlexServerContentRepository(IOmbiContext db) : base(db)
public PlexServerContentRepository(IExternalContext db) : base(db)
{
Db = db;
}
private IOmbiContext Db { get; }
private IExternalContext Db { get; }
public async Task<bool> ContentExists(string providerId)