Skip to content

Commit

Permalink
fix empty artists in purge
Browse files Browse the repository at this point in the history
  • Loading branch information
NattyNarwhal committed Dec 31, 2023
1 parent 023e9fe commit fdbffad
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ Doing so isn't fatal (it's not a secret), but it is annoying for other contribut
### Not yet released

* Files can be dropped onto the dock icon to import them.
* Empty artists entries are deleted from the local library on deleting downloaded items.

### Version 3.0

Expand Down
10 changes: 5 additions & 5 deletions Submariner/SBLibraryPurgeOperation.swift
Original file line number Diff line number Diff line change
Expand Up @@ -142,11 +142,11 @@ class SBLibraryPurgeOperation: SBOperation {
threadedContext.delete(album)
}
}
// then see if it's empty so we can delete
if albums.count == 0 {
threadedContext.delete(artist)
}
}

// then see if it's empty so we can delete
if let albums = artist.albums as! Set<SBAlbum>?, albums.count == 0 {
threadedContext.delete(artist)
}
}
}
Expand Down

0 comments on commit fdbffad

Please sign in to comment.