mirror of
https://github.com/danbee/persephone
synced 2025-03-04 08:39:11 +00:00
Remove saving to filesystem for now
This commit is contained in:
parent
50e58f7cac
commit
f1c9f25296
@ -352,7 +352,7 @@
|
|||||||
<constraints>
|
<constraints>
|
||||||
<constraint firstAttribute="width" constant="260" id="gK0-aW-CJy"/>
|
<constraint firstAttribute="width" constant="260" id="gK0-aW-CJy"/>
|
||||||
</constraints>
|
</constraints>
|
||||||
<buttonCell key="cell" type="check" title="Save fetched artwork to music directory" bezelStyle="regularSquare" imagePosition="left" inset="2" id="ZeZ-O4-vjS">
|
<buttonCell key="cell" type="check" title="Save fetched artwork to music directory" bezelStyle="regularSquare" imagePosition="left" enabled="NO" inset="2" id="ZeZ-O4-vjS">
|
||||||
<behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
|
<behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
|
||||||
<font key="font" metaFont="system"/>
|
<font key="font" metaFont="system"/>
|
||||||
</buttonCell>
|
</buttonCell>
|
||||||
@ -362,7 +362,7 @@
|
|||||||
<constraints>
|
<constraints>
|
||||||
<constraint firstAttribute="width" constant="144" id="DSX-th-Wn1"/>
|
<constraint firstAttribute="width" constant="144" id="DSX-th-Wn1"/>
|
||||||
</constraints>
|
</constraints>
|
||||||
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" selectable="YES" editable="YES" sendsActionOnEndEditing="YES" borderStyle="bezel" placeholderString="folder.jpg" drawsBackground="YES" id="nKF-YI-xBL">
|
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" selectable="YES" editable="YES" enabled="NO" sendsActionOnEndEditing="YES" borderStyle="bezel" placeholderString="folder.jpg" drawsBackground="YES" id="nKF-YI-xBL">
|
||||||
<font key="font" metaFont="system"/>
|
<font key="font" metaFont="system"/>
|
||||||
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
|
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
|
||||||
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
|
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
|
||||||
@ -370,9 +370,9 @@
|
|||||||
</textField>
|
</textField>
|
||||||
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="SmH-w6-5QI">
|
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="SmH-w6-5QI">
|
||||||
<rect key="frame" x="37" y="30" width="119" height="17"/>
|
<rect key="frame" x="37" y="30" width="119" height="17"/>
|
||||||
<textFieldCell key="cell" lineBreakMode="clipping" alignment="right" title="Cover art filename:" id="b4u-u7-iWD">
|
<textFieldCell key="cell" lineBreakMode="clipping" enabled="NO" alignment="right" title="Cover art filename:" id="b4u-u7-iWD">
|
||||||
<font key="font" metaFont="system"/>
|
<font key="font" metaFont="system"/>
|
||||||
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
|
<color key="textColor" name="secondaryLabelColor" catalog="System" colorSpace="catalog"/>
|
||||||
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
|
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
|
||||||
</textFieldCell>
|
</textFieldCell>
|
||||||
</textField>
|
</textField>
|
||||||
|
|||||||
@ -32,16 +32,6 @@ class AlbumArtService {
|
|||||||
self.getArtworkFromFilesystem()
|
self.getArtworkFromFilesystem()
|
||||||
}.then { (image: NSImage?) -> Promise<NSImage?> in
|
}.then { (image: NSImage?) -> Promise<NSImage?> in
|
||||||
image.map(Promise.value) ?? self.getRemoteArtwork()
|
image.map(Promise.value) ?? self.getRemoteArtwork()
|
||||||
}.compactMap(on :artworkQueue) { image in
|
|
||||||
if self.fileSystemArtworkFilePath() != nil {
|
|
||||||
let sizedImage = image?.toFitBox(
|
|
||||||
size: NSSize(width: self.bigArtworkSize, height: self.bigArtworkSize)
|
|
||||||
)
|
|
||||||
self.saveArtworkToFilesystem(data: sizedImage?.jpegData(compressionQuality: self.cachedArtworkQuality))
|
|
||||||
return sizedImage
|
|
||||||
} else {
|
|
||||||
return image
|
|
||||||
}
|
|
||||||
}.recover { (_) -> Guarantee<NSImage?> in
|
}.recover { (_) -> Guarantee<NSImage?> in
|
||||||
return .value(nil)
|
return .value(nil)
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user