optimize jellyfin collection scanning (#1453)

This commit is contained in:
Jason Dove
2023-09-29 09:47:57 -05:00
committed by GitHub
parent e8bc051f73
commit 3ab8e5bc3a
26 changed files with 9245 additions and 109 deletions
@@ -858,11 +858,19 @@ public class MediaSourceRepository : IMediaSourceRepository
return deletedMediaIds;
}
public async Task<Unit> UpdateLastScan(EmbyMediaSource embyMediaSource)
public async Task<Unit> UpdateLastCollectionScan(EmbyMediaSource embyMediaSource)
{
await using TvContext dbContext = await _dbContextFactory.CreateDbContextAsync();
return await dbContext.Connection.ExecuteAsync(
"UPDATE EmbyMediaSource SET LastCollectionsScan = @LastCollectionsScan WHERE Id = @Id",
new { embyMediaSource.LastCollectionsScan, embyMediaSource.Id }).ToUnit();
}
public async Task<Unit> UpdateLastCollectionScan(JellyfinMediaSource jellyfinMediaSource)
{
await using TvContext dbContext = await _dbContextFactory.CreateDbContextAsync();
return await dbContext.Connection.ExecuteAsync(
"UPDATE JellyfinMediaSource SET LastCollectionsScan = @LastCollectionsScan WHERE Id = @Id",
new { jellyfinMediaSource.LastCollectionsScan, jellyfinMediaSource.Id }).ToUnit();
}
}