Render image and video in galleries as a grid (#5929)

This commit is contained in:
Mauro
2026-07-24 18:47:39 +02:00
committed by GitHub
parent 5d0343c480
commit 274da99787
39 changed files with 464 additions and 5 deletions
@@ -11,15 +11,20 @@ struct ContentScannerServiceMockConfiguration {
/// The verdict reported for every source: `true` when safe, `false` when unsafe, or `nil` to
/// never resolve the scan so that the scanning state remains visible.
var scanResult: Bool?
/// Overrides `scanResult` on a per-source basis, using the same `true`/`false`/`nil` semantics.
var perSourceScanResult: (@Sendable (MediaSourceProxy) -> Bool?)?
}
extension ContentScannerServiceMock {
convenience init(_ configuration: ContentScannerServiceMockConfiguration) {
self.init()
scanResultFromSourceReturnValue = configuration.scanResult
loadScanResultFromSourceClosure = { _ in
guard let scanResult = configuration.scanResult else {
let blanketScanResult = configuration.scanResult
let resolve: @Sendable (MediaSourceProxy) -> Bool? = configuration.perSourceScanResult ?? { _ in blanketScanResult }
scanResultFromSourceClosure = { resolve($0) }
loadScanResultFromSourceClosure = { source in
guard let scanResult = resolve(source) else {
try? await Task.sleep(for: .seconds(3600))
return .failure(.failedScanning)
}