@ -96,6 +96,8 @@ namespace ErsatzTV.Core.Jellyfin
@@ -96,6 +96,8 @@ namespace ErsatzTV.Core.Jellyfin
foreach ( JellyfinMovie incoming in validMovies )
{
JellyfinMovie incomingMovie = incoming ;
decimal percentCompletion = ( decimal ) validMovies . IndexOf ( incoming ) / validMovies . Count ;
await _ mediator . Publish ( new LibraryScanProgress ( library . Id , percentCompletion ) ) ;
@ -122,12 +124,14 @@ namespace ErsatzTV.Core.Jellyfin
@@ -122,12 +124,14 @@ namespace ErsatzTV.Core.Jellyfin
updateStatistics = true ;
incoming . LibraryPathId = library . Paths . Head ( ) . Id ;
Option < JellyfinMovie > u pdated = await _ movieRepository . UpdateJellyfin ( incoming ) ;
if ( updated . IsSome )
Option < JellyfinMovie > maybeU pdated = await _ movieRepository . UpdateJellyfin ( incoming ) ;
foreach ( JellyfinMovie updated in maybeUpdated )
{
await _ searchIndex . UpdateItems (
_ searchRepository ,
new List < MediaItem > { updated . ValueUnsafe ( ) } ) ;
new List < MediaItem > { updated } ) ;
incomingMovie = updated ;
}
}
catch ( Exception ex )
@ -174,12 +178,12 @@ namespace ErsatzTV.Core.Jellyfin
@@ -174,12 +178,12 @@ namespace ErsatzTV.Core.Jellyfin
_l ogger . LogDebug ( "Refreshing {Attribute} for {Path}" , "Statistics" , localPath ) ;
Either < BaseError , bool > refreshResult =
await _l ocalStatisticsProvider . RefreshStatistics ( ffprobePath , incoming , localPath ) ;
await _l ocalStatisticsProvider . RefreshStatistics ( ffprobePath , incomingMovie , localPath ) ;
await refreshResult . Match (
async _ = >
{
Option < MediaItem > updated = await _ searchRepository . GetItemToIndex ( incoming . Id ) ;
Option < MediaItem > updated = await _ searchRepository . GetItemToIndex ( incomingMovie . Id ) ;
if ( updated . IsSome )
{
await _ searchIndex . UpdateItems (