Skip to content

Commit 9c1e0f4

Browse files
committed
If the file for the cover doesn't exist, fetch again
Recovers from the issue highlighted in the previous commit. May need debounce...
1 parent 279b04b commit 9c1e0f4

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ Doing so isn't fatal (it's not a secret), but it is annoying for other contribut
3737
* Top tracks for an artist can now be displayed
3838
* Similar tracks for an artist (sometimes called "radio") can now be displayed
3939
* Directories can be starred.
40+
* Recover from situations where the cover file was deleted from the filesystem.
4041
* Fix covers being deleted by the system on macOS 15.
4142
* Fix searches being ran twice.
4243
* Fix albums with the same ID across multiple servers being mixed.

Submariner/SBSubsonicParsingOperation.swift

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,8 @@ class SBSubsonicParsingOperation: SBOperation, XMLParserDelegate {
324324
album!.cover = cover
325325
}
326326

327-
if album?.cover?.imagePath == nil {
327+
let imagePath = album?.cover?.imagePath
328+
if imagePath == nil || !FileManager.default.fileExists(atPath: imagePath! as String) {
328329
server.getCover(id: coverArt, for: album!.itemId)
329330
}
330331
}
@@ -970,7 +971,8 @@ class SBSubsonicParsingOperation: SBOperation, XMLParserDelegate {
970971
attachedAlbum.cover = cover
971972
}
972973

973-
if attachedAlbum.cover?.imagePath == nil {
974+
let imagePath = attachedAlbum.cover?.imagePath
975+
if imagePath == nil || !FileManager.default.fileExists(atPath: imagePath! as String) {
974976
server.getCover(id: coverArt, for: attributeDict["albumId"])
975977
}
976978
}

0 commit comments

Comments
 (0)