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

Couple of tweaks

This commit is contained in:
Daniel Barber 2019-03-23 14:29:41 -04:00
parent ce5b0be2e1
commit 0147ffbfda
Signed by: danbarber
GPG Key ID: 931D8112E0103DD8
3 changed files with 12 additions and 24 deletions

View File

@ -52,24 +52,3 @@ class AlbumArtService {
}
}
}
//getCachedArtwork
// .then {
// callback($0)
// }
// .catch {
// getFileSystemArtwork
// }
// .then {
// callback($0)
// }
// .catch {
// getRemoteArtwork
// }4
// .then {
// callback($0)
// }
//
//// [() -> Promise<NSImage?>]
//// () -> Promise<NSImage>

View File

@ -36,9 +36,8 @@ extension AlbumArtService {
}.compactMap {
$0["releases"][0]["id"].string
}.compactMap {
URLComponents(string: "https://coverartarchive.org/release/\($0)/front-500")
}.then { (urlComponents: URLComponents?) -> Promise<(data: Data, response: URLResponse)> in
let url = urlComponents!.url
URLComponents(string: "https://coverartarchive.org/release/\($0)/front-500")?.url
}.then { (url: URL?) -> Promise<(data: Data, response: URLResponse)> in
return URLSession.shared.dataTask(.promise, with: url!).validate()
}.compactMap {
NSImage(data: $0.data)?.toFitBox(

10
bin/release Executable file
View File

@ -0,0 +1,10 @@
#!/bin/sh
set -o pipefail && \
xcodebuild \
-project Persephone.xcodeproj \
-scheme Persephone \
-destination platform\=macOS build \
-configuration Release \
| xcpretty