Added option to use lower resolution artworks in TagTunes
This commit is contained in:
committed by
Kim Wittenburg
parent
d49ad31b79
commit
dcd7d2620d
@@ -56,7 +56,7 @@ public class Artwork: iTunesType {
|
||||
let filePath = directory.stringByAppendingString("/\(filename).tiff")
|
||||
|
||||
try NSFileManager.defaultManager().createDirectoryAtPath(directory, withIntermediateDirectories: true, attributes: nil)
|
||||
let _ = NSFileManager.defaultManager().createFileAtPath(filePath, contents: hiResImage?.TIFFRepresentation, attributes: nil)
|
||||
let _ = NSFileManager.defaultManager().createFileAtPath(filePath, contents: saveImage?.TIFFRepresentation, attributes: nil)
|
||||
}
|
||||
|
||||
// MARK: Calculated Properties
|
||||
@@ -103,4 +103,18 @@ public class Artwork: iTunesType {
|
||||
return cachedHiResImage
|
||||
}
|
||||
|
||||
/// Returns the url of an image that should be used to display this artwork
|
||||
/// with respect to the user's preferences.
|
||||
public var displayImageURL: NSURL {
|
||||
if !Preferences.sharedPreferences.useLowResolutionArtwork && hiResURL != nil {
|
||||
return hiResURL
|
||||
}
|
||||
return url100
|
||||
}
|
||||
|
||||
/// Returns the image that should be used to save this artwork.
|
||||
public var saveImage: NSImage? {
|
||||
return hiResImage != nil ? hiResImage : image100
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user