mirror of
https://github.com/BinaryAlley/Nemera.git
synced 2026-12-03 14:11:10 +00:00
Fixes large library scans hitting the SQLite parameter limit
Bounds path lookups and enrichment resets to 20,000 parameters per query, restores failed scans from their staged metadata, and clears staged data only after the materialized items are saved.
This commit is contained in:
1 parent
800f4ab334
commit
6ef9592f00
22 files changed
+542
-94
No files matched your search
+11
-1
@@ -30,7 +30,7 @@ public interface ILibraryScanSnapshotRepository : IRepository<LibraryScanSnapsho
|
||||
/// <param name="libraryId">The unique identifier of the library whose media library scan snapshot item paths are retrieved.</param>
|
||||
/// <param name="cancellationToken">Cancellation token that can be used to stop the execution.</param>
|
||||
/// <returns>An <see cref="Result{TValue}"/> containing either a collection of media library scan snapshot item paths, or an error.</returns>
|
||||
Task<Result<IReadOnlyList<string>>> GetPathsAsync(Guid libraryId, CancellationToken cancellationToken);
|
||||
Task<Result<IReadOnlySet<string>>> GetPathsAsync(Guid libraryId, CancellationToken cancellationToken);
|
||||
|
||||
/// <summary>
|
||||
/// Atomically applies the results of the current scan to the storage medium, by replacing the media library scan snapshot of the previous scan with the snapshot of the current scan.
|
||||
@@ -43,4 +43,14 @@ public interface ILibraryScanSnapshotRepository : IRepository<LibraryScanSnapsho
|
||||
/// <param name="cancellationToken">Cancellation token that can be used to stop the execution.</param>
|
||||
/// <returns>An <see cref="Result{TValue}"/> representing either a successful operation, or an error.</returns>
|
||||
Task<Result<Updated>> ApplySnapshotSwapAsync(Guid libraryId, Guid scanId, Guid userId, CancellationToken cancellationToken);
|
||||
|
||||
/// <summary>
|
||||
/// Removes the media library scan snapshot entries that the scan identified by <paramref name="scanId"/> added or modified, restoring the snapshot to
|
||||
/// the state it had before the scan was applied.
|
||||
/// </summary>
|
||||
/// <param name="libraryId">The unique identifier of the library whose scan snapshot is rolled back.</param>
|
||||
/// <param name="scanId">The unique identifier of the media library scan whose snapshot entries are removed.</param>
|
||||
/// <param name="cancellationToken">Cancellation token that can be used to stop the execution.</param>
|
||||
/// <returns>An <see cref="Result{TValue}"/> representing either a successful operation, or an error.</returns>
|
||||
Task<Result<Deleted>> RollbackSnapshotForScanAsync(Guid libraryId, Guid scanId, CancellationToken cancellationToken);
|
||||
}
|
||||
+8
@@ -25,6 +25,14 @@ public interface IMusicLibraryScanItemMetadataRepository : IRepository<MusicLibr
|
||||
/// <returns>An <see cref="Result{TValue}"/> containing either a collection of <see cref="MusicLibraryScanItemMetadataEntity"/>, or an error.</returns>
|
||||
Task<Result<IReadOnlyList<MusicLibraryScanItemMetadataEntity>>> GetByScanIdAsync(Guid scanId, CancellationToken cancellationToken);
|
||||
|
||||
/// <summary>
|
||||
/// Gets all the staged music metadata items of the media library identified by <paramref name="libraryId"/>, regardless of the scan that staged them.
|
||||
/// </summary>
|
||||
/// <param name="libraryId">The Id of the media library whose staged music metadata is retrieved.</param>
|
||||
/// <param name="cancellationToken">Cancellation token that can be used to stop the execution.</param>
|
||||
/// <returns>An <see cref="Result{TValue}"/> containing either a collection of <see cref="MusicLibraryScanItemMetadataEntity"/>, or an error.</returns>
|
||||
Task<Result<IReadOnlyList<MusicLibraryScanItemMetadataEntity>>> GetByLibraryIdAsync(Guid libraryId, CancellationToken cancellationToken);
|
||||
|
||||
/// <summary>
|
||||
/// Deletes all the staged music metadata items of the media library scan identified by <paramref name="scanId"/>.
|
||||
/// </summary>
|
||||
|
||||
Reference in new issue
Block a user