Generate video thumbnails
This commit is contained in:
@@ -165,6 +165,21 @@ final class Content: ObservableObject {
|
||||
self.tagOverview = result.tagOverview
|
||||
self.didLoadContent = true
|
||||
callback([])
|
||||
self.generateMissingVideoThumbnails()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func generateMissingVideoThumbnails() {
|
||||
Task {
|
||||
for file in self.files {
|
||||
guard file.type.isVideo else { continue }
|
||||
guard !file.isExternallyStored else { continue }
|
||||
guard !storage.hasVideoThumbnail(for: file.id) else { continue }
|
||||
if await imageGenerator.createVideoThumbnail(for: file.id) {
|
||||
print("Generated thumbnail for \(file.id)")
|
||||
file.didChange()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user