New background task modes

This commit is contained in:
Christoph Hagen
2021-01-13 21:43:46 +01:00
parent 746b69defc
commit ffbacb7645
13 changed files with 797 additions and 661 deletions

View File

@@ -60,7 +60,7 @@ class GridViewController: UIViewController {
view.backgroundColor = tileColor(tile: tile)
} else {
let id = tiles[tile]
if let image = app.storage.thumbnail(for: id) {
if let image = app.database.storage.thumbnail(for: id) {
view.image = image
continue
}
@@ -216,7 +216,7 @@ class GridViewController: UIViewController {
return
}
if let image = app.storage.thumbnail(for: tiles[tile]) {
if let image = app.database.storage.thumbnail(for: tiles[tile]) {
view.image = image
return
}
@@ -238,7 +238,7 @@ class GridViewController: UIViewController {
self.log("No installed tile for downloaded image \(id)")
return
}
guard let image = app.storage.thumbnail(for: id) else {
guard let image = app.database.storage.thumbnail(for: id) else {
self.log("Failed to load image for cap \(id) after successful download")
return
}

View File

@@ -36,6 +36,8 @@ class ImageSelector: UIViewController {
private var images = [UIImage?]()
var cap: Cap!
weak var imageProvider: ImageProvider?
@IBOutlet weak var collection: UICollectionView!
@@ -97,7 +99,7 @@ class ImageSelector: UIViewController {
images = [UIImage?](repeating: nil, count: cap.count)
log("\(cap.count) images for cap \(cap.id)")
for version in 0..<cap.count {
if let image = app.storage.image(for: cap.id, version: version) {
if let image = imageProvider?.image(for: cap.id, version: version) {
log("Image \(version) already downloaded")
set(image, for: version)
} else {