diff --git a/Assets.xcassets/Placeholder.imageset/Contents.json b/Assets.xcassets/Placeholder.imageset/Contents.json new file mode 100644 index 0000000..239724e --- /dev/null +++ b/Assets.xcassets/Placeholder.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "filename" : "placeholder.png", + "scale" : "1x" + }, + { + "idiom" : "universal", + "filename" : "placeholder@2x.png", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Assets.xcassets/Placeholder.imageset/placeholder.png b/Assets.xcassets/Placeholder.imageset/placeholder.png new file mode 100644 index 0000000..9e6ede2 Binary files /dev/null and b/Assets.xcassets/Placeholder.imageset/placeholder.png differ diff --git a/Assets.xcassets/Placeholder.imageset/placeholder@2x.png b/Assets.xcassets/Placeholder.imageset/placeholder@2x.png new file mode 100644 index 0000000..885fbc2 Binary files /dev/null and b/Assets.xcassets/Placeholder.imageset/placeholder@2x.png differ diff --git a/Base.lproj/ArtworkSelector.xib b/Base.lproj/ArtworkSelector.xib index 6212101..ad79169 100755 --- a/Base.lproj/ArtworkSelector.xib +++ b/Base.lproj/ArtworkSelector.xib @@ -1,16 +1,15 @@ - + - - - + + - + - + @@ -18,7 +17,7 @@ - + @@ -28,41 +27,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + - + - + + + + - - + - - + + diff --git a/Base.lproj/ArtworkSelectorOld.xib b/Base.lproj/ArtworkSelectorOld.xib new file mode 100755 index 0000000..e7d5c28 --- /dev/null +++ b/Base.lproj/ArtworkSelectorOld.xib @@ -0,0 +1,137 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Classes/ArtworkSelector.swift b/Classes/ArtworkSelector.swift index f9a22e1..2c5e9b1 100644 --- a/Classes/ArtworkSelector.swift +++ b/Classes/ArtworkSelector.swift @@ -9,7 +9,7 @@ import Cocoa import Quartz private protocol ArtworkImageObjectDelegate: AnyObject { - func reloadData() + func reloadItem(_ item: ArtworkImageObject) } private class ArtworkImageObject : NSObject { @@ -36,6 +36,14 @@ private class ArtworkImageObject : NSObject { } } + func image() -> NSImage? { + if let data = imageRepresentation() as? Data { + return NSImage(data: data) + } else { + return nil + } + } + override func imageRepresentation() -> Any! { // Get the data outside the main thread var startDownload: Bool = false @@ -60,7 +68,7 @@ private class ArtworkImageObject : NSObject { // We got the data, tell the controller to update the view if localCancelled == false { DispatchQueue.main.async { - self.delegate?.reloadData() + self.delegate?.reloadItem(self) } } } @@ -106,7 +114,7 @@ protocol ArtworkSelectorControllerDelegate: AnyObject { func didSelect(artworks: [Artwork]) } -class ArtworkSelectorController: NSWindowController, ArtworkImageObjectDelegate { +class ArtworkSelectorControllerOldStyle: NSWindowController, ArtworkImageObjectDelegate { @IBOutlet var imageBrowser: IKImageBrowserView! @IBOutlet var slider: NSSlider! @@ -144,7 +152,7 @@ class ArtworkSelectorController: NSWindowController, ArtworkImageObjectDelegate } override public var windowNibName: NSNib.Name? { - return "ArtworkSelector" + return "ArtworkSelectorOld" } // MARK: - Load images @@ -175,7 +183,7 @@ class ArtworkSelectorController: NSWindowController, ArtworkImageObjectDelegate imageBrowser.needsDisplay = true } - fileprivate func reloadData() { + fileprivate func reloadItem(_ item: ArtworkImageObject) { imageBrowser.reloadData() } @@ -249,3 +257,213 @@ class ArtworkSelectorController: NSWindowController, ArtworkImageObjectDelegate } } + +@available(OSX 10.11, *) +class CollectionView : NSCollectionView { + override func keyDown(with event: NSEvent) { + guard let key = event.charactersIgnoringModifiers?.utf16.first else { super.keyDown(with: event); return } + + if key == NSEnterCharacter || key == NSCarriageReturnCharacter { + nextResponder?.keyDown(with: event) + } else if selectionIndexPaths.isEmpty { + if key == NSRightArrowFunctionKey || key == NSDownArrowFunctionKey { + animator().selectItems(at: Set([IndexPath(item: 0, section: 0)]), scrollPosition: .bottom) + } else if key == NSLeftArrowFunctionKey || key == NSUpArrowFunctionKey { + let numberOfItems = dataSource?.collectionView(self, numberOfItemsInSection: 0) ?? 1 + animator().selectItems(at: Set([IndexPath(item: numberOfItems - 1, section: 0)]), scrollPosition: .bottom) + } else { + super.keyDown(with: event) + } + } else { + super.keyDown(with: event) + } + } +} + + +@available(OSX 10.11, *) +class ArtworkSelectorController: NSWindowController, NSCollectionViewDataSource, NSCollectionViewDelegate, ArtworkImageObjectDelegate { + + @IBOutlet var imageBrowser: NSCollectionView! + @IBOutlet var slider: NSSlider! + @IBOutlet var addArtworkButton: NSButton! + @IBOutlet var loadMoreArtworkButton: NSButton! + + private var artworksUnloaded: [Artwork] + private var artworks: [ArtworkImageObject] + private let initialSize: CGSize? + private let type: MetadataType + + private weak var delegate: ArtworkSelectorControllerDelegate? + + // MARK: - Init + init(artworks: [Artwork], size: CGSize? = nil, type: MetadataType, delegate: ArtworkSelectorControllerDelegate) { + self.delegate = delegate + self.initialSize = size + self.artworksUnloaded = artworks + self.artworks = Array() + self.type = type + super.init(window: nil) + } + + required public init?(coder: NSCoder) { + fatalError("init(coder:) has not been implemented") + } + + deinit { + imageBrowser.delegate = nil + imageBrowser.dataSource = nil + + for artwork in artworks { + artwork.cancel() + } + } + + override public var windowNibName: NSNib.Name? { + return "ArtworkSelector" + } + + // MARK: - Load images + override public func windowDidLoad() { + super.windowDidLoad() + + window?.contentView?.wantsLayer = true + + if let size = initialSize { window?.setContentSize(size) } + + imageBrowser.register(ArtworkSelectorViewItem.self, forItemWithIdentifier: ArtworkSelectorController.itemView) + loadMoreArtworks(count: 8) + + if let defaultService = UserDefaults.standard.string(forKey: "SBArtworkSelectorDefaultService|\(type.description)"), + let defaultType = ArtworkType(rawValue: UserDefaults.standard.integer(forKey: "SBArtworkSelectorDefaultType|\(type.description)")) { + selectArtwork(type: defaultType, service: defaultService) + } + + if imageBrowser.selectionIndexPaths.count == 0 { + let indexPath = IndexPath(item: 0, section: 0) + imageBrowser.selectItems(at: [indexPath], scrollPosition: .top) + } + } + + @IBAction func loadMoreArtwork(_ sender: Any) { + loadMoreArtworks(count: 8) + } + + // MARK: - User Interface + + @IBAction func zoomSliderDidChange(_ sender: Any) { + if let layout = imageBrowser.collectionViewLayout as? NSCollectionViewFlowLayout { + layout.itemSize = NSSize(width: Int(slider.floatValue), height: Int(slider.floatValue * 1.25)) + } + } + + fileprivate func reloadItem(_ item: ArtworkImageObject) { + let selectionIndexPaths = imageBrowser.selectionIndexPaths + + if let index = artworks.firstIndex(of: item) { + let indexPath = IndexPath(item: index, section: 0) + imageBrowser.reloadItems(at: [indexPath]) + } + + if imageBrowser.selectionIndexPaths.isEmpty { + imageBrowser.selectionIndexPaths = selectionIndexPaths + } + } + + private func selectArtwork(at index: Int) { + let indexPath = IndexPath(item: 0, section: 0) + imageBrowser.selectItems(at: [indexPath], scrollPosition: .top) + addArtworkButton.isEnabled = imageBrowser.selectionIndexPaths.isEmpty == false + } + + private func loadMoreArtworks(count: Int) { + let endIndex = artworksUnloaded.count < count ? artworksUnloaded.count : count + let newArtworks = artworksUnloaded[0 ..< endIndex] + + artworks.append(contentsOf: newArtworks.map { ArtworkImageObject(artwork: $0, delegate: self) }) + artworksUnloaded.removeFirst(endIndex) + loadMoreArtworkButton.isEnabled = artworksUnloaded.isEmpty == false + + let range = (artworks.count - endIndex ..< artworks.count) + let indexes = range.map { IndexPath(item: $0, section: 0)} + + imageBrowser.insertItems(at: Set(indexes)) + } + + private func selectArtwork(type: ArtworkType, service: String) { + if let artwork = (artworks.filter { $0.source.type == type && $0.source.service == service } as [ArtworkImageObject]).first, + let index = artworks.index(of: artwork) { + selectArtwork(at: index) + } + else if let artwork = (artworks.filter { $0.source.type == type } as [ArtworkImageObject]).first, + let index = artworks.index(of: artwork) { + selectArtwork(at: index) + } + else if artworksUnloaded.isEmpty == false { + for (index, artwork) in artworksUnloaded.enumerated() { + if artwork.type == type { + let offset = artworks.count + loadMoreArtworks(count: index + 1) + selectArtwork(at: index + offset) + break + } + } + } + } + + private func selectedArtworks() -> [ArtworkImageObject] { + return imageBrowser.selectionIndexes.map { artworks[$0] } + } + + // MARK: - Finishing Up + @IBAction func addArtwork(_ sender: Any) { + delegate?.didSelect(artworks:selectedArtworks().map { $0.source }) + } + + @IBAction func addNoArtwork(_ sender: Any) { + delegate?.didSelect(artworks: []) + } + + // MARK: - Data source + + func collectionView(_ collectionView: NSCollectionView, numberOfItemsInSection section: Int) -> Int { + return artworks.count + } + + static let itemView = NSUserInterfaceItemIdentifier(rawValue: "ArtworkSelectorViewItem") + + func collectionView(_ collectionView: NSCollectionView, itemForRepresentedObjectAt indexPath: IndexPath) -> NSCollectionViewItem { + let item = collectionView.makeItem(withIdentifier: ArtworkSelectorController.itemView, for: indexPath) + guard let collectionViewItem = item as? ArtworkSelectorViewItem, let index = indexPath.last else { return item } + + let artwork = artworks[index] + + collectionViewItem.title = artwork.imageTitle() + collectionViewItem.subtitle = artwork.imageSubtitle() + collectionViewItem.image = artwork.image() + + collectionViewItem.doubleAction = #selector(addArtwork) + collectionViewItem.target = self + + return collectionViewItem + } + + // MARK: - Delegate + + private func updateSelection() { + addArtworkButton.isEnabled = imageBrowser.selectionIndexes.isEmpty == false + if let artwork = selectedArtworks().first { + UserDefaults.standard.set(artwork.source.type.rawValue, forKey: "SBArtworkSelectorDefaultType|\(type.description)") + UserDefaults.standard.set(artwork.source.service, forKey: "SBArtworkSelectorDefaultService|\(type.description)") + } + } + + func collectionView(_ collectionView: NSCollectionView, didSelectItemsAt indexPaths: Set) { + updateSelection() + } + + func collectionView(_ collectionView: NSCollectionView, didDeselectItemsAt indexPaths: Set) { + updateSelection() + } + +} diff --git a/Classes/ArtworkSelectorViewItem.swift b/Classes/ArtworkSelectorViewItem.swift new file mode 100644 index 0000000..dffaec3 --- /dev/null +++ b/Classes/ArtworkSelectorViewItem.swift @@ -0,0 +1,237 @@ +// +// ArtworkSelectorViewItem.swift +// Subler +// +// Created by Damiano Galassi on 13/06/2018. +// + +import Cocoa + +class ArtworkSelectorViewItemLabel : NSTextField { + + @IBInspectable var highlightColor: NSColor = .alternateSelectedControlColor + @IBInspectable var highlightTextColor: NSColor = .alternateSelectedControlTextColor + @IBInspectable var cornerRadius: CGFloat = 3 + + override func draw(_ dirtyRect: NSRect) { + var attributedString = attributedStringValue + if isHighlighted { + let mutableAttributedString = attributedString.mutableCopy() as! NSMutableAttributedString + let range = NSRange(location: 0, length: mutableAttributedString.length) + mutableAttributedString.removeAttribute(NSAttributedString.Key.foregroundColor, range: range) + mutableAttributedString.addAttributes([NSAttributedString.Key.foregroundColor : highlightTextColor], range: range) + attributedString = mutableAttributedString + } + let framesetter = CTFramesetterCreateWithAttributedString(attributedString) + + let path = CGMutablePath() + path.addRect(CGRect(x: 0, y: 0, width: bounds.size.width, height: bounds.size.height)) + + let totalFrame = CTFramesetterCreateFrame(framesetter, CFRange(), path, nil) + + guard let context = NSGraphicsContext.current?.cgContext else { return } + context.saveGState() + context.textMatrix = .identity + context.translateBy(x: 0, y: bounds.size.height) + context.scaleBy(x: 1, y: -1) + + // Highlight the text specified + let lines = CTFrameGetLines(totalFrame) as! [CTLine] + let lineCount = lines.count + + var origins = [CGPoint](repeating: CGPoint.zero, count: lineCount) + CTFrameGetLineOrigins(totalFrame, CFRange(), &origins) + + if isHighlighted { + for index in 0 ..< lineCount { + let line = lines[index] + let glyphRuns = CTLineGetGlyphRuns(line) as! [CTRun] + let glyphCount = glyphRuns.count + + let origin = origins[index] + // context.textPosition = pos + + for i in 0 ..< glyphCount { + let run = glyphRuns[i] + // let attributes = CTRunGetAttributes(run) + + // if CFDictionaryGetValue(attributes, "HighlightText") { + var runBounds = CGRect.zero + var ascent: CGFloat = 0, descent: CGFloat = 0, leading: CGFloat = 0 + + runBounds.size.width = CGFloat(CTRunGetTypographicBounds(run, CFRange(), &ascent, &descent, &leading)) + runBounds.size.height = ascent + descent + + runBounds.origin.x = CTLineGetOffsetForStringIndex(line, CTRunGetStringRange(run).location, nil) + origin.x + runBounds.origin.y = origin.y - descent + + let highlightCGColor = highlightColor.cgColor + let roundeRect = runBounds.insetBy(dx: -4, dy: 0) + let roundedPath = NSBezierPath(roundedRect: roundeRect.integral, xRadius: cornerRadius, yRadius: cornerRadius) + context.setFillColor(highlightCGColor) + roundedPath.fill() + + // CTRunDraw(run, context, CFRange()) + // } + } + } + } + CTFrameDraw(totalFrame, context) + context.restoreGState() + } +} + +class ArtworkSelectorViewItemView: NSView { + override func hitTest(_ point: NSPoint) -> NSView? { + guard let superview = superview else { return nil } + + if super.hitTest(point) != nil { + let convertedPoint = superview.convert(point, to: self) + if let layer = layer?.sublayers?.last { + if layer.hitTest(convertedPoint) != nil { + return self + } + } + return superview + } else { + return nil + } + } +} + +@available(OSX 10.11, *) +class ArtworkSelectorViewItem: NSCollectionViewItem { + + @IBOutlet var subTextField: NSTextField! + + private let imageLayer: CALayer = CALayer() + private let backgroundLayer: CALayer = CALayer() + + // MARK: Properties + + var doubleAction: Selector? + weak var target: AnyObject? + + override var title: String? { + set (title) { + textField?.stringValue = title ?? "" + super.title = title + } + get { + return super.title + } + } + + var subtitle: String? { + didSet { + subTextField?.stringValue = subtitle ?? "" + } + } + + var image: NSImage? { + didSet { + if image != nil { + imageLayer.contents = image + imageLayer.shadowOpacity = 0.8 + } else { + imageLayer.contents = NSImage(imageLiteralResourceName: "Placeholder") + } + } + } + + override var highlightState: NSCollectionViewItem.HighlightState { + set (value) { + super.highlightState = value + updateSelectionHighlight() + } + get { + return super.highlightState + } + } + + override var isSelected: Bool { + set (value) { + super.isSelected = value + updateSelectionHighlight() + } + get { + return super.isSelected + } + } + + // MARK: View Controller life cycle + + override func viewDidLoad() { + super.viewDidLoad() + +// self.view.layer?.shouldRasterize = true + self.view.canDrawSubviewsIntoLayer = true + + imageLayer.anchorPoint = CGPoint.zero + imageLayer.position = CGPoint(x: 4, y: 40) + imageLayer.contentsGravity = .resizeAspect + imageLayer.shadowRadius = 1 + imageLayer.shadowColor = NSColor.labelColor.cgColor + imageLayer.shadowOffset = CGSize.zero + imageLayer.isOpaque = true + backgroundLayer.anchorPoint = CGPoint.zero + backgroundLayer.position = CGPoint(x: 0, y: 36) + backgroundLayer.backgroundColor = NSColor.controlHighlightColor.cgColor + backgroundLayer.cornerRadius = 8 + backgroundLayer.isHidden = true + backgroundLayer.isOpaque = true + + let actions: [String : CAAction] = ["contents": NSNull(), + "hidden": NSNull(), + "bounds": NSNull()] + imageLayer.actions = actions + backgroundLayer.actions = actions + + view.layer?.addSublayer(backgroundLayer) + view.layer?.addSublayer(imageLayer) + } + + override func viewDidLayout() { + let bounds = self.view.bounds + + imageLayer.bounds = CGRect(x: 0, y: 0, width: bounds.width - 8, height: bounds.height - 44) + backgroundLayer.bounds = CGRect(x: 0, y: 0, width: bounds.width, height: bounds.height - 36) + + super.viewDidLayout() + } + + static private let paragraph: NSParagraphStyle = { + let paragraph = NSMutableParagraphStyle() + paragraph.alignment = .center + return paragraph + }() + + private func updateSelectionHighlight() { + if highlightState == .forSelection || (isSelected && highlightState != .forDeselection) { + backgroundLayer.isHidden = false + textField?.isHighlighted = true + } else { + backgroundLayer.isHidden = true + textField?.isHighlighted = false + } + } + + // MARK: Actions + + override func mouseUp(with event: NSEvent) { + if event.clickCount > 1, let action = doubleAction { + target?.performSelector(onMainThread: action, with: nil, waitUntilDone: true) + } else { + super.mouseUp(with: event) + } + } + + override func keyDown(with event: NSEvent) { + if event.keyCode == NSEnterCharacter, let action = doubleAction { + target?.performSelector(onMainThread: action, with: nil, waitUntilDone: true) + } else { + super.keyDown(with: event) + } + } + +} diff --git a/Classes/ArtworkSelectorViewItem.xib b/Classes/ArtworkSelectorViewItem.xib new file mode 100644 index 0000000..b0eda17 --- /dev/null +++ b/Classes/ArtworkSelectorViewItem.xib @@ -0,0 +1,44 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Classes/DocumentWindowController.swift b/Classes/DocumentWindowController.swift index e25ab1e..de3a16a 100644 --- a/Classes/DocumentWindowController.swift +++ b/Classes/DocumentWindowController.swift @@ -191,7 +191,7 @@ class DocumentWindowController: NSWindowController, TracksViewControllerDelegate @IBOutlet var searchChapters: NSToolbarItem! @IBOutlet var sendToQueue: NSToolbarItem! - override func validateToolbarItem(_ item: NSToolbarItem) -> Bool { + override func validate(_ item: NSToolbarItem) -> Bool { if item == addTracks || item == searchMetadata || item == searchChapters || diff --git a/Classes/MetadataSearchController.swift b/Classes/MetadataSearchController.swift index 80e85a4..b9ea357 100644 --- a/Classes/MetadataSearchController.swift +++ b/Classes/MetadataSearchController.swift @@ -61,7 +61,7 @@ class MetadataSearchController: NSWindowController, NSTableViewDataSource, NSTab private var tvShowService: MetadataService = MetadataSearch.defaultTVService // MARK: Other - private var artworkSelector: ArtworkSelectorController? + private var artworkSelector: NSWindowController? private weak var delegate: MetadataSearchControllerDelegate? private let terms: MetadataSearchTerms @@ -298,10 +298,17 @@ class MetadataSearchController: NSWindowController, NSTableViewDataSource, NSTab } private func selectArtwork(artworks: [Artwork], type: MetadataType) { - let artworkSelectorController = ArtworkSelectorController(artworks: artworks, size: window?.frame.size, - type: type, delegate: self) - window?.beginSheet(artworkSelectorController.window!, completionHandler: nil) - artworkSelector = artworkSelectorController + if #available(OSX 10.11, *) { + let artworkSelectorController = ArtworkSelectorController(artworks: artworks, size: window?.frame.size, + type: type, delegate: self) + window?.beginSheet(artworkSelectorController.window!, completionHandler: nil) + artworkSelector = artworkSelectorController + } else { + let artworkSelectorController = ArtworkSelectorControllerOldStyle(artworks: artworks, size: window?.frame.size, + type: type, delegate: self) + window?.beginSheet(artworkSelectorController.window!, completionHandler: nil) + artworkSelector = artworkSelectorController + } } func didSelect(artworks: [Artwork]) { diff --git a/Subler.xcodeproj/project.pbxproj b/Subler.xcodeproj/project.pbxproj index 539d45d..1beb427 100644 --- a/Subler.xcodeproj/project.pbxproj +++ b/Subler.xcodeproj/project.pbxproj @@ -61,6 +61,10 @@ A984DB4B0F52D644001A20B2 /* Sparkle.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A984DB4A0F52D644001A20B2 /* Sparkle.framework */; }; A984DB530F52D679001A20B2 /* Sparkle.framework in Copy Files */ = {isa = PBXBuildFile; fileRef = A984DB4A0F52D644001A20B2 /* Sparkle.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; }; A984DB740F52DD4B001A20B2 /* dsa_pub.pem in Resources */ = {isa = PBXBuildFile; fileRef = A984DB730F52DD4B001A20B2 /* dsa_pub.pem */; }; + A98542D720D197D300EB9803 /* ArtworkSelector.xib in Resources */ = {isa = PBXBuildFile; fileRef = A98542D520D197D300EB9803 /* ArtworkSelector.xib */; }; + A98542D920D197DF00EB9803 /* ArtworkSelector.swift in Sources */ = {isa = PBXBuildFile; fileRef = A98542D820D197DF00EB9803 /* ArtworkSelector.swift */; }; + A98542DC20D1A7E500EB9803 /* ArtworkSelectorViewItem.swift in Sources */ = {isa = PBXBuildFile; fileRef = A98542DA20D1A7E500EB9803 /* ArtworkSelectorViewItem.swift */; }; + A98542DD20D1A7E500EB9803 /* ArtworkSelectorViewItem.xib in Resources */ = {isa = PBXBuildFile; fileRef = A98542DB20D1A7E500EB9803 /* ArtworkSelectorViewItem.xib */; }; A9859ACE1F4B43CC00022828 /* QueuePreset.swift in Sources */ = {isa = PBXBuildFile; fileRef = A9859ACD1F4B43CC00022828 /* QueuePreset.swift */; }; A98D44102036F661005CB092 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = A98D440F2036F661005CB092 /* AppDelegate.swift */; }; A98D98461F0280CB00A77ABC /* TheMovieDB.swift in Sources */ = {isa = PBXBuildFile; fileRef = A98D98451F0280CB00A77ABC /* TheMovieDB.swift */; }; @@ -111,7 +115,6 @@ A9D73C5218BF3F1100C6FFA6 /* SBQueue.m in Sources */ = {isa = PBXBuildFile; fileRef = A9D73C5118BF3F1100C6FFA6 /* SBQueue.m */; }; A9DA3B9C1B918D5C00F1E40C /* SBApplication.m in Sources */ = {isa = PBXBuildFile; fileRef = A9DA3B991B918D5C00F1E40C /* SBApplication.m */; }; A9DA3BA31B918D6F00F1E40C /* ExceptionAlert.xib in Resources */ = {isa = PBXBuildFile; fileRef = A9DA3BA11B918D6F00F1E40C /* ExceptionAlert.xib */; }; - A9E932A71F34D31D00B1790B /* ArtworkSelector.swift in Sources */ = {isa = PBXBuildFile; fileRef = A9E932A61F34D31D00B1790B /* ArtworkSelector.swift */; }; A9E97F141F274F1100DBA586 /* iTunesStore.swift in Sources */ = {isa = PBXBuildFile; fileRef = A9E97F131F274F1100DBA586 /* iTunesStore.swift */; }; A9ECA0532029948900D5F30C /* OffsetViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = A9ECA0512029948900D5F30C /* OffsetViewController.swift */; }; A9ECA0572029A10B00D5F30C /* DocumentWindowController.xib in Resources */ = {isa = PBXBuildFile; fileRef = A9ECA0592029A10B00D5F30C /* DocumentWindowController.xib */; }; @@ -126,7 +129,7 @@ A9F7F8E01837C44B0036AE7E /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A9ED7B21180067A2008FD3A8 /* IOKit.framework */; }; A9F8045A1FB6F4FD0069FF43 /* ImageBrowserView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A9F804591FB6F4FD0069FF43 /* ImageBrowserView.swift */; }; A9FC6FF61EF2E3280034CCED /* TheTVDBService.swift in Sources */ = {isa = PBXBuildFile; fileRef = A9FC6FF51EF2E3280034CCED /* TheTVDBService.swift */; }; - CD4E6E5D12F744210095C84F /* ArtworkSelector.xib in Resources */ = {isa = PBXBuildFile; fileRef = CD4E6E5B12F744210095C84F /* ArtworkSelector.xib */; }; + CD4E6E5D12F744210095C84F /* ArtworkSelectorOld.xib in Resources */ = {isa = PBXBuildFile; fileRef = CD4E6E5B12F744210095C84F /* ArtworkSelectorOld.xib */; }; CD71FEA612F1B62600F0A98D /* MetadataSearch.xib in Resources */ = {isa = PBXBuildFile; fileRef = CD71FEA412F1B62600F0A98D /* MetadataSearch.xib */; }; CDE8E452174CBBD4009410B5 /* iTunesStores.json in Resources */ = {isa = PBXBuildFile; fileRef = CDE8E451174CBBD4009410B5 /* iTunesStores.json */; }; /* End PBXBuildFile section */ @@ -218,7 +221,7 @@ A924A5111D4B9E66008301A7 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Classes/PropertyView/Base.lproj/VideoView.xib; sourceTree = ""; }; A924A5121D4B9E66008301A7 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/MainMenu.xib; sourceTree = ""; }; A924A5141D4B9E66008301A7 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/MetadataSearch.xib; sourceTree = ""; }; - A924A5151D4B9E66008301A7 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/ArtworkSelector.xib; sourceTree = ""; }; + A924A5151D4B9E66008301A7 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/ArtworkSelectorOld.xib; sourceTree = ""; }; A924A5161D4B9E66008301A7 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/SBChapterSearch.xib; sourceTree = ""; }; A924A5171D4B9E66008301A7 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/Queue.xib; sourceTree = ""; }; A924A5181D4B9E66008301A7 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/QueueOptions.xib; sourceTree = ""; }; @@ -267,6 +270,10 @@ A982D0BF140AB66400B92357 /* SBQueueItem.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = SBQueueItem.m; path = Classes/SBQueueItem.m; sourceTree = ""; }; A984DB4A0F52D644001A20B2 /* Sparkle.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = Sparkle.framework; sourceTree = ""; }; A984DB730F52DD4B001A20B2 /* dsa_pub.pem */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = dsa_pub.pem; sourceTree = ""; }; + A98542D620D197D300EB9803 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/ArtworkSelector.xib; sourceTree = ""; }; + A98542D820D197DF00EB9803 /* ArtworkSelector.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = ArtworkSelector.swift; path = Classes/ArtworkSelector.swift; sourceTree = ""; }; + A98542DA20D1A7E500EB9803 /* ArtworkSelectorViewItem.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = ArtworkSelectorViewItem.swift; path = Classes/ArtworkSelectorViewItem.swift; sourceTree = ""; }; + A98542DB20D1A7E500EB9803 /* ArtworkSelectorViewItem.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = ArtworkSelectorViewItem.xib; path = Classes/ArtworkSelectorViewItem.xib; sourceTree = ""; }; A9859ACD1F4B43CC00022828 /* QueuePreset.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = QueuePreset.swift; path = Classes/QueuePreset.swift; sourceTree = ""; }; A98D440F2036F661005CB092 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = AppDelegate.swift; path = Classes/AppDelegate.swift; sourceTree = ""; }; A98D98451F0280CB00A77ABC /* TheMovieDB.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = TheMovieDB.swift; path = Classes/MetadataImporters/TheMovieDB.swift; sourceTree = ""; }; @@ -302,7 +309,7 @@ A9BA1AD61DBF773600FD0B38 /* it */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = it; path = Classes/PropertyView/it.lproj/VideoView.strings; sourceTree = ""; }; A9BA1AD71DBF773600FD0B38 /* it */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = it; path = it.lproj/MainMenu.strings; sourceTree = ""; }; A9BA1AD91DBF773700FD0B38 /* it */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = it; path = it.lproj/MetadataSearch.strings; sourceTree = ""; }; - A9BA1ADA1DBF773700FD0B38 /* it */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = it; path = it.lproj/ArtworkSelector.strings; sourceTree = ""; }; + A9BA1ADA1DBF773700FD0B38 /* it */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = it; path = it.lproj/ArtworkSelectorOld.strings; sourceTree = ""; }; A9BA1ADD1DBF773700FD0B38 /* it */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = it; path = it.lproj/SBChapterSearch.strings; sourceTree = ""; }; A9BA1ADE1DBF773700FD0B38 /* it */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = it; path = it.lproj/Queue.strings; sourceTree = ""; }; A9BA1ADF1DBF773700FD0B38 /* it */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = it; path = it.lproj/QueueOptions.strings; sourceTree = ""; }; @@ -330,7 +337,6 @@ A9D73C5118BF3F1100C6FFA6 /* SBQueue.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = SBQueue.m; path = Classes/SBQueue.m; sourceTree = ""; }; A9DA3B991B918D5C00F1E40C /* SBApplication.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = SBApplication.m; path = Classes/SBApplication.m; sourceTree = ""; }; A9DA3BA01B918D6200F1E40C /* SBApplication.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = SBApplication.h; path = Classes/SBApplication.h; sourceTree = ""; }; - A9E932A61F34D31D00B1790B /* ArtworkSelector.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = ArtworkSelector.swift; path = Classes/ArtworkSelector.swift; sourceTree = ""; }; A9E97F131F274F1100DBA586 /* iTunesStore.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = iTunesStore.swift; path = Classes/MetadataImporters/iTunesStore.swift; sourceTree = ""; }; A9E9E5291FB21B4000BCC49D /* it */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = it; path = it.lproj/FileImportController.strings; sourceTree = ""; }; A9ECA0512029948900D5F30C /* OffsetViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = OffsetViewController.swift; path = Classes/OffsetViewController.swift; sourceTree = ""; }; @@ -601,8 +607,11 @@ A9A4A968202F51FA00482D12 /* SaveOptions.xib */, A962D9ED1F8B7F9F00802EEF /* FileImportController.swift */, A93105351F9758EC00605146 /* FileImportController.xib */, - A9E932A61F34D31D00B1790B /* ArtworkSelector.swift */, - CD4E6E5B12F744210095C84F /* ArtworkSelector.xib */, + A98542D820D197DF00EB9803 /* ArtworkSelector.swift */, + CD4E6E5B12F744210095C84F /* ArtworkSelectorOld.xib */, + A98542D520D197D300EB9803 /* ArtworkSelector.xib */, + A98542DA20D1A7E500EB9803 /* ArtworkSelectorViewItem.swift */, + A98542DB20D1A7E500EB9803 /* ArtworkSelectorViewItem.xib */, A997B0A91F348AB000974C9C /* MetadataSearchController.swift */, CD71FEA412F1B62600F0A98D /* MetadataSearch.xib */, A99189D01F2F88F700623ED7 /* ChapterSearchController.swift */, @@ -708,6 +717,11 @@ 8D15AC270486D014006FF6A4 = { LastSwiftMigration = 1000; ProvisioningStyle = Automatic; + SystemCapabilities = { + com.apple.Sandbox = { + enabled = 0; + }; + }; }; A95B8DA31B09F37700F2F152 = { CreatedOnToolsVersion = 6.3.1; @@ -776,6 +790,7 @@ A9EEA5F818D654B9008B54B4 /* QueueOptions.xib in Resources */, A9AB486617F0AEFD000AA72E /* MovieView.xib in Resources */, A9C31E5D2029A79000CEF474 /* GeneralPrefsViewController.xib in Resources */, + A98542DD20D1A7E500EB9803 /* ArtworkSelectorViewItem.xib in Resources */, 8D15AC2C0486D014006FF6A4 /* Credits.rtf in Resources */, A9ECA05A2029A10F00D5F30C /* TracksViewController.xib in Resources */, A9AB486717F0AEFD000AA72E /* SoundView.xib in Resources */, @@ -796,12 +811,13 @@ CD71FEA612F1B62600F0A98D /* MetadataSearch.xib in Resources */, A90CD5C01FD177230070A067 /* TokensViewController.xib in Resources */, A9A4A96B202F51FF00482D12 /* ProgressViewController.xib in Resources */, - CD4E6E5D12F744210095C84F /* ArtworkSelector.xib in Resources */, + CD4E6E5D12F744210095C84F /* ArtworkSelectorOld.xib in Resources */, 61CEC0CE1E7569E4000FECC1 /* MultiSelectView.xib in Resources */, A9BC410818D9ABC000F8C92C /* QueueItem.xib in Resources */, A9D4B8671C05BD04007845C4 /* SBChapterSearch.xib in Resources */, A9C31E642029A82200CEF474 /* AdvancedPrefsViewController.xib in Resources */, A998DABF1BA54CFF004D7969 /* MediaTagsController.xib in Resources */, + A98542D720D197D300EB9803 /* ArtworkSelector.xib in Resources */, A9ECA0602029A13800D5F30C /* OffsetViewController.xib in Resources */, A961476713F568210068F161 /* Queue.xib in Resources */, A9BA1AF31DBF7DD800FD0B38 /* Localizable.strings in Resources */, @@ -834,6 +850,7 @@ A959001A202AF21800FD8F23 /* ProgressViewController.swift in Sources */, A91576EB204ECA6E00D93CE7 /* Token.swift in Sources */, A9676A341FB6EAAD00C1E300 /* ItemViewController.swift in Sources */, + A98542DC20D1A7E500EB9803 /* ArtworkSelectorViewItem.swift in Sources */, A90C3E0C1FD16AF200F64532 /* TokensViewController.swift in Sources */, A9AB485617F0AEAC000AA72E /* SBMovieViewController.m in Sources */, A9C09C7C1F99F460007939EE /* ExceptionAlertController.swift in Sources */, @@ -841,6 +858,7 @@ A9676A301FB6E85300C1E300 /* LanguageTransformer.swift in Sources */, A9907E192063DAA000DB992E /* VideoViewController.swift in Sources */, A98D98461F0280CB00A77ABC /* TheMovieDB.swift in Sources */, + A98542D920D197DF00EB9803 /* ArtworkSelector.swift in Sources */, A99B9A842063AD98000FAE20 /* MovieViewControllerAdditions.swift in Sources */, A98D98481F02820F00A77ABC /* TheMovieDBService.swift in Sources */, A962D9EE1F8B7F9F00802EEF /* FileImportController.swift in Sources */, @@ -870,7 +888,6 @@ A9C09C981F99F971007939EE /* ExpandedTableView.swift in Sources */, A90240DB2063BD3700E762FA /* MediaTagsController.swift in Sources */, A997B0AA1F348AB000974C9C /* MetadataSearchController.swift in Sources */, - A9E932A71F34D31D00B1790B /* ArtworkSelector.swift in Sources */, A9D73C5218BF3F1100C6FFA6 /* SBQueue.m in Sources */, A956CE6B1F99EAAD00093992 /* Logger.swift in Sources */, A956CE691F99E93D00093992 /* ButtonToolbarItem.swift in Sources */, @@ -1042,6 +1059,14 @@ name = Queue.xib; sourceTree = ""; }; + A98542D520D197D300EB9803 /* ArtworkSelector.xib */ = { + isa = PBXVariantGroup; + children = ( + A98542D620D197D300EB9803 /* Base */, + ); + name = ArtworkSelector.xib; + sourceTree = ""; + }; A998DABD1BA54CFF004D7969 /* MediaTagsController.xib */ = { isa = PBXVariantGroup; children = ( @@ -1234,13 +1259,13 @@ name = QueueOptions.xib; sourceTree = ""; }; - CD4E6E5B12F744210095C84F /* ArtworkSelector.xib */ = { + CD4E6E5B12F744210095C84F /* ArtworkSelectorOld.xib */ = { isa = PBXVariantGroup; children = ( A924A5151D4B9E66008301A7 /* Base */, A9BA1ADA1DBF773700FD0B38 /* it */, ); - name = ArtworkSelector.xib; + name = ArtworkSelectorOld.xib; sourceTree = ""; }; CD71FEA412F1B62600F0A98D /* MetadataSearch.xib */ = { @@ -1338,8 +1363,11 @@ CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_OBJC_ARC = YES; CLANG_ENABLE_OBJC_WEAK = YES; - CODE_SIGN_ENTITLEMENTS = ""; + CODE_SIGN_ENTITLEMENTS = Subler.entitlements; + CODE_SIGN_IDENTITY = "Mac Developer"; + CODE_SIGN_STYLE = Automatic; COPY_PHASE_STRIP = NO; + DEVELOPMENT_TEAM = 5X9DE89KYV; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", "\"$(SRCROOT)\"", @@ -1354,6 +1382,7 @@ OTHER_LDFLAGS = "-Wl,-rpath,@loader_path/../Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = "org.galad.${PRODUCT_NAME:identifier}"; PRODUCT_NAME = Subler; + PROVISIONING_PROFILE_SPECIFIER = ""; SDKROOT = macosx; SWIFT_OBJC_BRIDGING_HEADER = "Subler-Bridging-Header.h"; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; @@ -1369,7 +1398,10 @@ CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_OBJC_ARC = YES; CLANG_ENABLE_OBJC_WEAK = YES; - CODE_SIGN_ENTITLEMENTS = ""; + CODE_SIGN_ENTITLEMENTS = Subler.entitlements; + CODE_SIGN_IDENTITY = "Mac Developer"; + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_TEAM = 5X9DE89KYV; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", "\"$(SRCROOT)\"", @@ -1383,6 +1415,7 @@ OTHER_LDFLAGS = "-Wl,-rpath,@loader_path/../Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = "org.galad.${PRODUCT_NAME:identifier}"; PRODUCT_NAME = Subler; + PROVISIONING_PROFILE_SPECIFIER = ""; SDKROOT = macosx; SWIFT_OBJC_BRIDGING_HEADER = "Subler-Bridging-Header.h"; SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; @@ -1394,6 +1427,7 @@ isa = XCBuildConfiguration; buildSettings = { ASSETCATALOG_COMPILER_OPTIMIZATION = space; + CLANG_ANALYZER_GCD_PERFORMANCE = YES; CLANG_ANALYZER_LOCALIZABILITY = YES; CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; CLANG_ANALYZER_NONNULL = YES; @@ -1431,6 +1465,7 @@ GCC_C_LANGUAGE_STANDARD = c11; GCC_NO_COMMON_BLOCKS = YES; GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ""; GCC_VERSION = ""; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_ABOUT_MISSING_FIELD_INITIALIZERS = YES; @@ -1463,6 +1498,7 @@ isa = XCBuildConfiguration; buildSettings = { ASSETCATALOG_COMPILER_OPTIMIZATION = space; + CLANG_ANALYZER_GCD_PERFORMANCE = YES; CLANG_ANALYZER_LOCALIZABILITY = YES; CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; CLANG_ANALYZER_NONNULL = YES; @@ -1496,6 +1532,7 @@ ENABLE_STRICT_OBJC_MSGSEND = YES; GCC_C_LANGUAGE_STANDARD = c11; GCC_NO_COMMON_BLOCKS = YES; + GCC_PREPROCESSOR_DEFINITIONS = ""; GCC_VERSION = ""; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_ABOUT_MISSING_FIELD_INITIALIZERS = YES; diff --git a/it.lproj/ArtworkSelector.strings b/it.lproj/ArtworkSelectorOld.strings similarity index 100% rename from it.lproj/ArtworkSelector.strings rename to it.lproj/ArtworkSelectorOld.strings