From dc73d25248ba6ec453efac9507a8813579d08971 Mon Sep 17 00:00:00 2001 From: Guillaume Louel <37544189+glouel@users.noreply.github.com> Date: Sat, 13 May 2023 18:43:02 +0200 Subject: [PATCH] Fix playback speed slider not showing on videos (again) --- Aerial.xcodeproj/project.pbxproj | 8 ++++---- Aerial/Source/Models/Cache/Cache.swift | 2 +- .../Source/Models/Cache/VideoDownload.swift | 2 +- Aerial/Source/Models/Music/Music.swift | 6 +++--- Aerial/Source/Models/Sources/VideoList.swift | 5 +++-- Resources/MainUI/PanelWindowController.swift | 4 ++-- .../Settings panels/CacheViewController.swift | 2 +- .../PlayingCollectionViewItem.swift | 4 ---- .../NowPlayingViewController.swift | 3 +-- Resources/MainUI/VideosViewController.swift | 20 ++++++++----------- 10 files changed, 24 insertions(+), 32 deletions(-) diff --git a/Aerial.xcodeproj/project.pbxproj b/Aerial.xcodeproj/project.pbxproj index 1c752e4b..6dcdee82 100644 --- a/Aerial.xcodeproj/project.pbxproj +++ b/Aerial.xcodeproj/project.pbxproj @@ -3265,7 +3265,7 @@ CODE_SIGN_IDENTITY = "Developer ID Application"; CODE_SIGN_STYLE = Manual; COMBINE_HIDPI_IMAGES = YES; - CURRENT_PROJECT_VERSION = 3.2.2beta1; + CURRENT_PROJECT_VERSION = 3.2.5; DEFINES_MODULE = YES; DEVELOPMENT_TEAM = 3L54M5L5KK; ENABLE_HARDENED_RUNTIME = YES; @@ -3273,7 +3273,7 @@ INSTALL_PATH = "$(HOME)/Library/Screen Savers"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks"; MACOSX_DEPLOYMENT_TARGET = 10.13; - MARKETING_VERSION = 3.2.2beta1; + MARKETING_VERSION = 3.2.5; PRODUCT_BUNDLE_IDENTIFIER = com.johncoates.Aerial; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; @@ -3294,7 +3294,7 @@ CODE_SIGN_IDENTITY = "Developer ID Application"; CODE_SIGN_STYLE = Manual; COMBINE_HIDPI_IMAGES = YES; - CURRENT_PROJECT_VERSION = 3.2.2beta1; + CURRENT_PROJECT_VERSION = 3.2.5; DEFINES_MODULE = YES; DEVELOPMENT_TEAM = 3L54M5L5KK; ENABLE_HARDENED_RUNTIME = YES; @@ -3302,7 +3302,7 @@ INSTALL_PATH = "$(HOME)/Library/Screen Savers"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks"; MACOSX_DEPLOYMENT_TARGET = 10.13; - MARKETING_VERSION = 3.2.2beta1; + MARKETING_VERSION = 3.2.5; OTHER_CODE_SIGN_FLAGS = "--timestamp"; PRODUCT_BUNDLE_IDENTIFIER = com.johncoates.Aerial; PRODUCT_NAME = "$(TARGET_NAME)"; diff --git a/Aerial/Source/Models/Cache/Cache.swift b/Aerial/Source/Models/Cache/Cache.swift index 2e1b958d..25b5a225 100644 --- a/Aerial/Source/Models/Cache/Cache.swift +++ b/Aerial/Source/Models/Cache/Cache.swift @@ -622,7 +622,7 @@ struct Cache { formatter.locale = Locale.current // USA: Locale(identifier: "en_US") formatter.numberStyle = .decimal let result = formatter.string(from: NSNumber(value: PrefsCache.cacheLimit.rounded(toPlaces: 1)))! - print(result) // -> US$9,999.99 + //print(result) // -> US$9,999.99 if !Aerial.helper.showAlert(question: "Your cache is full", text: "Your cache limit is currently set to \(result) GB, and currently contains \(Cache.sizeString()) of files.\n\n Do you want to proceed with the download anyway?\n\nYou can manually increase or decrease your cache size in Settings > Cache.", diff --git a/Aerial/Source/Models/Cache/VideoDownload.swift b/Aerial/Source/Models/Cache/VideoDownload.swift index 2ca2d7b2..fd950472 100644 --- a/Aerial/Source/Models/Cache/VideoDownload.swift +++ b/Aerial/Source/Models/Cache/VideoDownload.swift @@ -48,7 +48,7 @@ final class VideoDownload: NSObject, NSURLConnectionDataDelegate { } deinit { - print("deinit VideoDownload") + //print("deinit VideoDownload") } func startDownload() { diff --git a/Aerial/Source/Models/Music/Music.swift b/Aerial/Source/Models/Music/Music.swift index 67d5b242..11b23d2e 100644 --- a/Aerial/Source/Models/Music/Music.swift +++ b/Aerial/Source/Models/Music/Music.swift @@ -234,7 +234,7 @@ class Music { songId = fetchId(id: userInfo["Store URL"] as! String) } - print(userInfo) + //print(userInfo) // Let everyone who wants to know that we have a new song playing ! for callback in callbacks { @@ -244,7 +244,7 @@ class Music { } @objc func spotifyCallback(_ aNotification: Notification) { - print(aNotification) + //print(aNotification) var album = "" var name = "" var artist = "" @@ -297,7 +297,7 @@ class Music { guard let artworkUrl = spotifySong.thumbnailURL else { debugLog("No artwork in SpotifySong") - print(spotifySong) + //print(spotifySong) completion(nil) return } diff --git a/Aerial/Source/Models/Sources/VideoList.swift b/Aerial/Source/Models/Sources/VideoList.swift index 44f811b2..b6bda0f1 100644 --- a/Aerial/Source/Models/Sources/VideoList.swift +++ b/Aerial/Source/Models/Sources/VideoList.swift @@ -177,10 +177,11 @@ class VideoList { filters.append(afilter.lowercased()) } } - print("Filters :") + + /*print("Filters :") for filter in filters { print(filter) - } + }*/ /*print("Videos : ") for video in videos { diff --git a/Resources/MainUI/PanelWindowController.swift b/Resources/MainUI/PanelWindowController.swift index 2e131824..f35e0cd8 100644 --- a/Resources/MainUI/PanelWindowController.swift +++ b/Resources/MainUI/PanelWindowController.swift @@ -183,12 +183,12 @@ import Cocoa // Switch from one source to another func switchTo(_ path: String) { - print("switch to :" + path) + //print("switch to :" + path) guard let currentPath = currentPath, let videosVC = videosVC, path != currentPath else { - print("switch init issue") + //print("switch init issue") return } diff --git a/Resources/MainUI/Settings panels/CacheViewController.swift b/Resources/MainUI/Settings panels/CacheViewController.swift index 7fb02d83..0ec767a2 100644 --- a/Resources/MainUI/Settings panels/CacheViewController.swift +++ b/Resources/MainUI/Settings panels/CacheViewController.swift @@ -114,7 +114,7 @@ class CacheViewController: NSViewController { let usedCache = Cache.size() let packsSize = Cache.packsSize() - print("pack size : \(packsSize)") + //print("pack size : \(packsSize)") var maxCache = PrefsCache.cacheLimit var freeCache = usedCache > maxCache ? 0 : maxCache - usedCache diff --git a/Resources/MainUI/Settings panels/Collection View/PlayingCollectionViewItem.swift b/Resources/MainUI/Settings panels/Collection View/PlayingCollectionViewItem.swift index 5f8bd688..498eadd3 100644 --- a/Resources/MainUI/Settings panels/Collection View/PlayingCollectionViewItem.swift +++ b/Resources/MainUI/Settings panels/Collection View/PlayingCollectionViewItem.swift @@ -35,13 +35,10 @@ class PlayingCollectionViewItem: NSCollectionViewItem { @IBAction func browseButton(_ sender: Any) { - print("browse button") - print(hiddenPath.stringValue) Aerial.helper.windowController?.browseTo(hiddenPath.stringValue) } @IBAction func mainImageClick(_ sender: NSButton) { - print("click in") let path = hiddenPath.stringValue if checkImageButton.state == .on { @@ -63,7 +60,6 @@ class PlayingCollectionViewItem: NSCollectionViewItem { } } @IBAction func imageButtonClick(_ sender: NSButton) { - print("click") let path = hiddenPath.stringValue if sender.state == .on { diff --git a/Resources/MainUI/Settings panels/NowPlayingViewController.swift b/Resources/MainUI/Settings panels/NowPlayingViewController.swift index e76f29ae..702d496e 100644 --- a/Resources/MainUI/Settings panels/NowPlayingViewController.swift +++ b/Resources/MainUI/Settings panels/NowPlayingViewController.swift @@ -118,7 +118,7 @@ class NowPlayingViewController: NSViewController { for source in subSources { let path = mode + source - print(path) + if !PrefsVideos.newShouldPlayString.contains(path) { PrefsVideos.newShouldPlayString.append(path) } @@ -127,7 +127,6 @@ class NowPlayingViewController: NSViewController { } @IBAction func statusHiddenVideoButtonClick(_ sender: Any) { - print("Hidden B") Aerial.helper.windowController?.browseTo("hidden:0") } diff --git a/Resources/MainUI/VideosViewController.swift b/Resources/MainUI/VideosViewController.swift index 8374ec7e..03572532 100644 --- a/Resources/MainUI/VideosViewController.swift +++ b/Resources/MainUI/VideosViewController.swift @@ -165,13 +165,12 @@ class VideosViewController: NSViewController { let subpath = path.split(separator: ":")[1] - print(subpath) + //print(subpath) // Very unswift var index = 0 for item in VideoList.instance.getSources(mode: foundMode) { if subpath == item { - print(index) rotationSecondaryPopup.selectItem(at: index) rotationSecondaryPopupChange(rotationSecondaryPopup) } @@ -183,7 +182,6 @@ class VideosViewController: NSViewController { /// Reload the video view for a given path func reloadFor(path: String) { self.path = path - print("rf " + self.path!) updateRotationMenu() updateRuntimeLabel() @@ -275,8 +273,6 @@ class VideosViewController: NSViewController { mode = "all" } - print("rpc " + mode!) - // Cascade to a secondary popup for the various filters if mode == "all" || mode == "favorites" || mode == "hidden" { rotationSecondaryPopup.isHidden = true @@ -286,15 +282,12 @@ class VideosViewController: NSViewController { rotationSecondaryPopup.isHidden = false updateRotationSecondaryMenu() } - - // print(path!) } /// Secondary popup change event @IBAction func rotationSecondaryPopupChange(_ sender: NSPopUpButton) { // PrefsVideos.shouldPlayString = sender.selectedItem!.title path = mode! + ":\(sender.indexOfSelectedItem)" - print(path!) reloadFor(path: path!) } @@ -335,7 +328,6 @@ class VideosViewController: NSViewController { // PrefsVideos.shouldPlayString = rotationSecondaryPopup.itemTitle(at: 0) rotationSecondaryPopup.selectItem(at: 0) path = mode! + ":0" - print(path!) reloadFor(path: path!) } } @@ -407,6 +399,10 @@ class VideosViewController: NSViewController { /// Show video player func showVideo(_ video: AerialVideo) { + playbackSpeedLabel.isHidden = false + playbackSpeedSlider.isHidden = false + + heroPlayerView.isHidden = false heroImageView.isHidden = true isCachedImageView.isHidden = false @@ -582,7 +578,7 @@ class VideosViewController: NSViewController { } } else { // all - print(VideoList.instance.videos.count) + //print(VideoList.instance.videos.count) if VideoList.instance.videos.count > 0 { return VideoList.instance.videos .filter({ !PrefsVideos.hidden.contains($0.id) }) @@ -687,7 +683,7 @@ extension VideosViewController: NSTableViewDataSource { return 0 } - print("nor path : " + path) + //print("nor path : " + path) if let mode = VideoList.instance.modeFromPath(path) { let index = Int(path.split(separator: ":")[1])! @@ -705,7 +701,7 @@ extension VideosViewController: NSTableViewDelegate { return nil } - print("tv path : " + path) + //print("tv path : " + path) var video: AerialVideo if let mode = VideoList.instance.modeFromPath(path) {