feat(data): list the files one import job recorded from a card
A read-only query so an import's verification result can match every planned copy to the record its own job wrote. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012iLMBNwBE2GnphAsu4cjaC
This commit is contained in:
2 files changed
+33
No files matched your search
@@ -116,6 +116,15 @@ public sealed class MediaCardRepository
|
||||
r.GetStringOrNull(4), r.GetGuidOrNull(5), r.GetGuidOrNull(6), r.GetDateTimeOffset(7)),
|
||||
cancellationToken);
|
||||
|
||||
/// <summary>The files one import job recorded from a card, by path (the import's verification result).</summary>
|
||||
public Task<IReadOnlyList<ImportRecord>> ListImportsByJobAsync(Guid cardId, Guid jobId, CancellationToken cancellationToken = default) =>
|
||||
_db.ListAsync(
|
||||
"SELECT card_id, path, size, mtime, sha256, frame_id, job_id, imported_at FROM import_history WHERE card_id = $1 AND job_id = $2 ORDER BY path",
|
||||
[cardId, jobId],
|
||||
r => new ImportRecord(r.GetGuid(0), new ImportKey(r.GetString(1), r.GetInt64(2), r.GetDateTimeOffset(3)),
|
||||
r.GetStringOrNull(4), r.GetGuidOrNull(5), r.GetGuidOrNull(6), r.GetDateTimeOffset(7)),
|
||||
cancellationToken);
|
||||
|
||||
private static MediaCard Map(DbRow r) => new()
|
||||
{
|
||||
Id = r.GetGuid(0),
|
||||
|
||||
Reference in new issue
Block a user