diff --git a/Resources/Info.plist b/Resources/Info.plist index eca42b7..0254a8f 100644 --- a/Resources/Info.plist +++ b/Resources/Info.plist @@ -9,9 +9,9 @@ CFBundleExecutable Wallpaper CFBundleVersion - 1.1.1 + 1.1.2 CFBundleShortVersionString - 1.1.1 + 1.1.2 CFBundlePackageType APPL CFBundleIconFile diff --git a/Sources/Wallpaper/WallpaperApp.swift b/Sources/Wallpaper/WallpaperApp.swift index 6249c5f..0c12a3b 100644 --- a/Sources/Wallpaper/WallpaperApp.swift +++ b/Sources/Wallpaper/WallpaperApp.swift @@ -91,9 +91,9 @@ struct WallpaperApp: App { enabled: !manager.images.isEmpty ) { if manager.isCurrentDisliked { - manager.undoDislike() + Task { await manager.undoDislike() } } else { - Task { await manager.dislike() } + manager.dislike() } } .help(manager.isCurrentDisliked ? "Unskip" : "Skip this wallpaper") diff --git a/Sources/Wallpaper/WallpaperManager.swift b/Sources/Wallpaper/WallpaperManager.swift index 019b233..d151efb 100644 --- a/Sources/Wallpaper/WallpaperManager.swift +++ b/Sources/Wallpaper/WallpaperManager.swift @@ -260,18 +260,19 @@ class WallpaperManager { // MARK: - Like/Dislike/Favorite Actions - func dislike() async { + func dislike() { guard currentIndex >= 0, currentIndex < images.count else { return } let image = images[currentIndex] store.addDislike(image.startdate) // Remove from favorites if present store.removeFavorite(image) - await navigateToNextNonDisliked() } - func undoDislike() { + func undoDislike() async { guard currentIndex >= 0, currentIndex < images.count else { return } store.removeDislike(images[currentIndex].startdate) + do { try await applyWallpaper(at: currentIndex) } + catch { errorMessage = error.localizedDescription } } func toggleFavorite() { @@ -313,18 +314,6 @@ class WallpaperManager { return NSImage(contentsOf: localURL) } - private func navigateToNextNonDisliked() async { - // Try newer images first (lower indices), then older images - let candidates = Array(0..