mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-08-23 06:25:24 -07:00
Abstract media server content repository
This commit is contained in:
parent
aeeba5b22d
commit
a309f50d15
4 changed files with 29 additions and 23 deletions
|
@ -6,19 +6,16 @@ using Ombi.Store.Entities;
|
|||
|
||||
namespace Ombi.Store.Repository
|
||||
{
|
||||
public interface IEmbyContentRepository : IRepository<EmbyContent>
|
||||
public interface IEmbyContentRepository : IMediaServerContentRepository<EmbyContent, EmbyEpisode>
|
||||
{
|
||||
Task<EmbyContent> GetByEmbyId(string embyId);
|
||||
Task<EmbyEpisode> GetEpisodeByEmbyId(string key);
|
||||
|
||||
// TODO: merge these with IJellyfinContentRepository
|
||||
IQueryable<EmbyContent> Get();
|
||||
Task<EmbyContent> GetByTheMovieDbId(string mov);
|
||||
Task<EmbyContent> GetByTvDbId(string tv);
|
||||
Task<EmbyContent> GetByImdbId(string imdbid);
|
||||
Task<EmbyContent> GetByEmbyId(string embyId);
|
||||
Task Update(EmbyContent existingContent);
|
||||
IQueryable<EmbyEpisode> GetAllEpisodes();
|
||||
Task<EmbyEpisode> Add(EmbyEpisode content);
|
||||
Task<EmbyEpisode> GetEpisodeByEmbyId(string key);
|
||||
Task AddRange(IEnumerable<EmbyEpisode> content);
|
||||
|
||||
void UpdateWithoutSave(EmbyContent existingContent);
|
||||
}
|
||||
}
|
|
@ -6,19 +6,16 @@ using Ombi.Store.Entities;
|
|||
|
||||
namespace Ombi.Store.Repository
|
||||
{
|
||||
public interface IJellyfinContentRepository : IRepository<JellyfinContent>
|
||||
public interface IJellyfinContentRepository : IMediaServerContentRepository<JellyfinContent, JellyfinEpisode>
|
||||
{
|
||||
Task<JellyfinContent> GetByJellyfinId(string jellyfinId);
|
||||
Task<JellyfinEpisode> GetEpisodeByJellyfinId(string key);
|
||||
|
||||
// TODO: merge these with IEmbyContentRepository
|
||||
IQueryable<JellyfinContent> Get();
|
||||
Task<JellyfinContent> GetByTheMovieDbId(string mov);
|
||||
Task<JellyfinContent> GetByTvDbId(string tv);
|
||||
Task<JellyfinContent> GetByImdbId(string imdbid);
|
||||
Task<JellyfinContent> GetByJellyfinId(string jellyfinId);
|
||||
Task Update(JellyfinContent existingContent);
|
||||
IQueryable<JellyfinEpisode> GetAllEpisodes();
|
||||
Task<JellyfinEpisode> Add(JellyfinEpisode content);
|
||||
Task<JellyfinEpisode> GetEpisodeByJellyfinId(string key);
|
||||
Task AddRange(IEnumerable<JellyfinEpisode> content);
|
||||
|
||||
void UpdateWithoutSave(JellyfinContent existingContent);
|
||||
}
|
||||
}
|
||||
|
|
17
src/Ombi.Store/Repository/IMediaServerContentRepository.cs
Normal file
17
src/Ombi.Store/Repository/IMediaServerContentRepository.cs
Normal file
|
@ -0,0 +1,17 @@
|
|||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using Ombi.Store.Entities;
|
||||
|
||||
namespace Ombi.Store.Repository
|
||||
{
|
||||
public interface IMediaServerContentRepository<Content, Episode> : IExternalRepository<Content> where Content : Entity
|
||||
{
|
||||
Task Update(Content existingContent);
|
||||
IQueryable<Episode> GetAllEpisodes();
|
||||
Task<Episode> Add(Episode content);
|
||||
Task AddRange(IEnumerable<Episode> content);
|
||||
|
||||
void UpdateWithoutSave(Content existingContent);
|
||||
}
|
||||
}
|
|
@ -8,23 +8,18 @@ using Ombi.Store.Entities;
|
|||
|
||||
namespace Ombi.Store.Repository
|
||||
{
|
||||
public interface IPlexContentRepository : IExternalRepository<PlexServerContent>
|
||||
public interface IPlexContentRepository : IMediaServerContentRepository<PlexServerContent, PlexEpisode>
|
||||
{
|
||||
Task<bool> ContentExists(string providerId);
|
||||
Task<PlexServerContent> Get(string providerId, ProviderType type);
|
||||
Task<PlexServerContent> GetByType(string providerId, ProviderType type, MediaType plexType);
|
||||
Task<PlexServerContent> GetByType(string providerId, ProviderType type, MediaType MediaServerType);
|
||||
Task<PlexServerContent> GetByKey(int key);
|
||||
Task Update(PlexServerContent existingContent);
|
||||
IQueryable<PlexEpisode> GetAllEpisodes();
|
||||
Task<PlexEpisode> Add(PlexEpisode content);
|
||||
Task<PlexEpisode> GetEpisodeByKey(int key);
|
||||
Task AddRange(IEnumerable<PlexEpisode> content);
|
||||
IEnumerable<PlexServerContent> GetWhereContentByCustom(Expression<Func<PlexServerContent, bool>> predicate);
|
||||
Task<PlexServerContent> GetFirstContentByCustom(Expression<Func<PlexServerContent, bool>> predicate);
|
||||
Task DeleteEpisode(PlexEpisode content);
|
||||
void DeleteWithoutSave(PlexServerContent content);
|
||||
void DeleteWithoutSave(PlexEpisode content);
|
||||
Task UpdateRange(IEnumerable<PlexServerContent> existingContent);
|
||||
void UpdateWithoutSave(PlexServerContent existingContent);
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue