Added the emby episode cacher and the job to check if items are available on emby #1464 #865

This commit is contained in:
tidusjar 2017-09-02 00:46:04 +01:00
parent 012a82ca2d
commit b8224f5895
12 changed files with 358 additions and 21 deletions

View file

@ -88,25 +88,26 @@ namespace Ombi.Store.Repository
await Db.SaveChangesAsync();
}
//public IQueryable<PlexEpisode> GetAllEpisodes()
//{
// return Db.PlexEpisode.AsQueryable();
//}
public IQueryable<EmbyEpisode> GetAllEpisodes()
{
return Db.EmbyEpisode.AsQueryable();
}
//public async Task<PlexEpisode> Add(PlexEpisode content)
//{
// await Db.PlexEpisode.AddAsync(content);
// await Db.SaveChangesAsync();
// return content;
//}
//public async Task<PlexEpisode> GetEpisodeByKey(int key)
//{
// return await Db.PlexEpisode.FirstOrDefaultAsync(x => x.Key == key);
//}
//public async Task AddRange(IEnumerable<PlexEpisode> content)
//{
// Db.PlexEpisode.AddRange(content);
// await Db.SaveChangesAsync();
//}
public async Task<EmbyEpisode> Add(EmbyEpisode content)
{
await Db.EmbyEpisode.AddAsync(content);
await Db.SaveChangesAsync();
return content;
}
public async Task<EmbyEpisode> GetEpisodeByEmbyId(string key)
{
return await Db.EmbyEpisode.FirstOrDefaultAsync(x => x.EmbyId == key);
}
public async Task AddRange(IEnumerable<EmbyEpisode> content)
{
Db.EmbyEpisode.AddRange(content);
await Db.SaveChangesAsync();
}
}
}