rework emby collection scanning (#1205)

* optimize emby collection scan frequency

* add button to sync emby collections

* update changelog

* fix scanning; add progress indicator
This commit is contained in:
Jason Dove
2023-03-11 22:29:10 -06:00
committed by GitHub
parent 35445e2b3d
commit 78745de0ca
21 changed files with 4817 additions and 28 deletions
@@ -88,22 +88,6 @@ public class SynchronizeEmbyLibraryByIdHandler : IRequestHandler<SynchronizeEmby
{
parameters.Library.LastScan = DateTime.UtcNow;
await _libraryRepository.UpdateLastScan(parameters.Library);
// need to call get libraries to find library that contains collections (box sets)
await _embyApiClient.GetLibraries(
parameters.ConnectionParameters.ActiveConnection.Address,
parameters.ConnectionParameters.ApiKey);
Either<BaseError, Unit> collectionResult = await _mediator.Send(
new SynchronizeEmbyCollections(parameters.Library.MediaSourceId),
cancellationToken);
collectionResult.BiIter(
_ => _logger.LogDebug("Done synchronizing emby collections"),
error => _logger.LogWarning(
"Unable to synchronize emby collections for source {MediaSourceId}: {Error}",
parameters.Library.MediaSourceId,
error.Value));
}
foreach (BaseError error in result.LeftToSeq())