Various ThemeDownloader Updates

- `try` added where applicable to ArticleTheme inits
- `ArticleThemePlist` has fixed spelling of theme identifier and conforms to Equatable
- `ArticleTheme` now uses `ArticleThemePlist`
-  `ArticleThemeDownloader` is now a class
- `ArticleThemeDownloader` will now download themes to Application Support/NetNewsWire/Downloads on macOS and iOS.
- `ArticleThemeDownloader` will remove downloaded themes from the Download folder when the application is closed.
- macOS app delegate now observes for theme download fails
- Error display code moved from SceneDelegate to SceneCoordinator so that it can use existing presentError on rootVC.
This commit is contained in:
Stuart Breckenridge
2021-09-21 09:10:56 +08:00
parent 7986e1caee
commit 78e0595708
11 changed files with 130 additions and 89 deletions

View File

@@ -61,9 +61,9 @@ extension AppDelegate : AppDelegateAppleEvents {
}
do {
try ArticleThemeDownloader.handleFile(at: location)
try ArticleThemeDownloader.shared.handleFile(at: location)
} catch {
print(error)
NotificationCenter.default.post(name: .didEndDownloadingThemeWithError, object: nil, userInfo: ["error": error])
}
}
task.resume()