1
1
mirror of https://github.com/danbee/persephone synced 2025-03-04 08:39:11 +00:00

Compiler couldn't infer type here

This commit is contained in:
Daniel Barber 2019-03-27 09:06:35 -04:00
parent 2fb0ceeaee
commit da5bafd7fd
Signed by: danbarber
GPG Key ID: 931D8112E0103DD8

View File

@ -30,9 +30,9 @@ class AlbumArtService {
firstly { firstly {
self.getCachedArtwork() self.getCachedArtwork()
}.then { artwork -> Promise<NSImage?> in }.then { artwork -> Promise<NSImage?> in
artwork.map(Promise.value) ?? self.cacheIfNecessary(self.getArtworkFromFilesystem()) artwork.map { Promise.value($0 as NSImage?) } ?? self.cacheIfNecessary(self.getArtworkFromFilesystem())
}.then { artwork -> Promise<NSImage?> in }.then { artwork -> Promise<NSImage?> in
artwork.map(Promise.value) ?? self.cacheIfNecessary(self.getArtworkFromMusicBrainz().map(Optional.some)) artwork.map { Promise.value($0 as NSImage?) } ?? self.cacheIfNecessary(self.getArtworkFromMusicBrainz().map(Optional.some))
}.tap { result in }.tap { result in
switch result { switch result {
case .fulfilled(nil), .rejected(MusicBrainzError.noArtworkAvailable): case .fulfilled(nil), .rejected(MusicBrainzError.noArtworkAvailable):