mirror of https://github.com/ErsatzTV/ErsatzTV.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
30 lines
925 B
30 lines
925 B
using ErsatzTV.Core.Domain; |
|
using ErsatzTV.Infrastructure.Data; |
|
using Microsoft.EntityFrameworkCore; |
|
|
|
namespace ErsatzTV.Application.Search; |
|
|
|
public abstract class QuerySearchIndexHandlerBase |
|
{ |
|
protected static async Task<Option<JellyfinMediaSource>> GetJellyfin( |
|
TvContext dbContext, |
|
CancellationToken cancellationToken) |
|
{ |
|
return await dbContext.JellyfinMediaSources |
|
.AsNoTracking() |
|
.Include(p => p.Connections) |
|
.ToListAsync(cancellationToken) |
|
.Map(list => list.HeadOrNone()); |
|
} |
|
|
|
protected static async Task<Option<EmbyMediaSource>> GetEmby( |
|
TvContext dbContext, |
|
CancellationToken cancellationToken) |
|
{ |
|
return await dbContext.EmbyMediaSources |
|
.AsNoTracking() |
|
.Include(p => p.Connections) |
|
.ToListAsync(cancellationToken) |
|
.Map(list => list.HeadOrNone()); |
|
} |
|
}
|
|
|