|
|
|
@ -67,10 +67,13 @@ public class CallLocalLibraryScannerHandler : CallLibraryScannerHandler<IScanLoc |
|
|
|
|
|
|
|
|
|
|
|
protected override async Task<DateTimeOffset> GetLastScan(TvContext dbContext, IScanLocalLibrary request) |
|
|
|
protected override async Task<DateTimeOffset> GetLastScan(TvContext dbContext, IScanLocalLibrary request) |
|
|
|
{ |
|
|
|
{ |
|
|
|
return await dbContext.LibraryPaths |
|
|
|
var libraryPaths = await dbContext.LibraryPaths |
|
|
|
.Filter(lp => lp.LibraryId == request.LibraryId) |
|
|
|
.Filter(lp => lp.LibraryId == request.LibraryId) |
|
|
|
.ToListAsync() |
|
|
|
.ToListAsync(); |
|
|
|
.Map(list => list.Min(lp => lp.LastScan ?? SystemTime.MinValueUtc)); |
|
|
|
|
|
|
|
|
|
|
|
return libraryPaths.Any() |
|
|
|
|
|
|
|
? libraryPaths.Min(lp => lp.LastScan ?? SystemTime.MinValueUtc) |
|
|
|
|
|
|
|
: SystemTime.MaxValueUtc; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
protected override bool ScanIsRequired( |
|
|
|
protected override bool ScanIsRequired( |
|
|
|
|