Skip to content

Commit

Permalink
Merge pull request JohnCoates#881 from glouel/master
Browse files Browse the repository at this point in the history
1.6.4
  • Loading branch information
glouel committed Nov 1, 2019
2 parents 8460fa8 + f41e909 commit f54de33
Show file tree
Hide file tree
Showing 7 changed files with 139 additions and 33 deletions.
12 changes: 6 additions & 6 deletions Aerial.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -995,7 +995,7 @@
INFOPLIST_FILE = Aerial/App/Resources/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks";
MACOSX_DEPLOYMENT_TARGET = 10.9;
MARKETING_VERSION = 1.6.0;
MARKETING_VERSION = 1.6.4;
PRODUCT_BUNDLE_IDENTIFIER = "com.johncoates.Aerial-Test";
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
Expand All @@ -1018,7 +1018,7 @@
INFOPLIST_FILE = Aerial/App/Resources/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks";
MACOSX_DEPLOYMENT_TARGET = 10.9;
MARKETING_VERSION = 1.6.0;
MARKETING_VERSION = 1.6.4;
PRODUCT_BUNDLE_IDENTIFIER = "com.johncoates.Aerial-Test";
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
Expand Down Expand Up @@ -1185,15 +1185,15 @@
CODE_SIGN_IDENTITY = "Developer ID Application: Guillaume Louel (3L54M5L5KK)";
CODE_SIGN_STYLE = Manual;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 1.6.2;
CURRENT_PROJECT_VERSION = 1.6.4;
DEFINES_MODULE = YES;
DEVELOPMENT_TEAM = 3L54M5L5KK;
ENABLE_HARDENED_RUNTIME = YES;
INFOPLIST_FILE = "$(SRCROOT)/Resources/Info.plist";
INSTALL_PATH = "$(HOME)/Library/Screen Savers";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks";
MACOSX_DEPLOYMENT_TARGET = 10.9;
MARKETING_VERSION = 1.6.2;
MARKETING_VERSION = 1.6.4;
PRODUCT_BUNDLE_IDENTIFIER = com.johncoates.Aerial;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
Expand All @@ -1214,15 +1214,15 @@
CODE_SIGN_IDENTITY = "Developer ID Application: Guillaume Louel (3L54M5L5KK)";
CODE_SIGN_STYLE = Manual;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 1.6.2;
CURRENT_PROJECT_VERSION = 1.6.4;
DEFINES_MODULE = YES;
DEVELOPMENT_TEAM = 3L54M5L5KK;
ENABLE_HARDENED_RUNTIME = YES;
INFOPLIST_FILE = "$(SRCROOT)/Resources/Info.plist";
INSTALL_PATH = "$(HOME)/Library/Screen Savers";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks";
MACOSX_DEPLOYMENT_TARGET = 10.9;
MARKETING_VERSION = 1.6.2;
MARKETING_VERSION = 1.6.4;
OTHER_CODE_SIGN_FLAGS = "--timestamp";
PRODUCT_BUNDLE_IDENTIFIER = com.johncoates.Aerial;
PRODUCT_NAME = "$(TARGET_NAME)";
Expand Down
4 changes: 2 additions & 2 deletions Aerial/Source/Controllers/PWC Tabs/PWC+Cache.swift
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ extension PreferencesWindowController {
}

func updateCacheSize() {
// get your directory url
let documentsDirectoryURL = URL(fileURLWithPath: VideoCache.cacheDirectory!)
// get your directory url, we now use App support
let documentsDirectoryURL = URL(fileURLWithPath: VideoCache.appSupportDirectory!)

// FileManager.default.urls(for: VideoCache.cacheDirectory, in: .userDomainMask).first!

Expand Down
11 changes: 11 additions & 0 deletions Aerial/Source/Controllers/PWC Tabs/PWC+Videos.swift
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,10 @@ extension PreferencesWindowController {
popoverPower.show(relativeTo: button.preparedContentRect, of: button, preferredEdge: .maxY)
}

@IBAction func helpHDRButtonClick(_ button: NSButton) {
popoverHDR.show(relativeTo: button.preparedContentRect, of: button, preferredEdge: .maxY)
}

@IBAction func fadeInOutModePopupChange(_ sender: NSPopUpButton) {
debugLog("UI fadeInOutMode: \(sender.indexOfSelectedItem)")
preferences.fadeMode = sender.indexOfSelectedItem
Expand Down Expand Up @@ -241,6 +245,13 @@ extension PreferencesWindowController {
}
}

// MARK: Wikipedia popup link
@IBAction func linkToWikipediaDolbyVisionClick(_ sender: Any) {
let workspace = NSWorkspace.shared
let url = URL(string: "https://en.wikipedia.org/wiki/Dolby_Laboratories#Video_processing")!
workspace.open(url)
}

// MARK: Video playback

// Rewind preview video when reaching end
Expand Down
5 changes: 4 additions & 1 deletion Aerial/Source/Controllers/PreferencesWindowController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ final class PreferencesWindowController: NSWindowController, NSOutlineViewDataSo
@IBOutlet var popoverHEVCLabel: NSTextField!
@IBOutlet var secondProjectPageLink: NSButton!

@IBOutlet var popoverHDR: NSPopover!

@IBOutlet var popoverTime: NSPopover!
@IBOutlet var linkTimeWikipediaButton: NSButton!

Expand Down Expand Up @@ -252,7 +254,6 @@ final class PreferencesWindowController: NSWindowController, NSOutlineViewDataSo
return formatter
}()

// MARK: - Init
required init?(coder decoder: NSCoder) {
self.fontManager = NSFontManager.shared
debugLog("pwc init1")
Expand Down Expand Up @@ -500,6 +501,8 @@ final class PreferencesWindowController: NSWindowController, NSOutlineViewDataSo
self.outlineView.reloadData()
self.outlineView.expandItem(nil, expandChildren: true)
}

// We update the info in the advanced tab
let (description, total) = ManifestLoader.instance.getOldFilesEstimation()
videoVersionsLabel.stringValue = description
if total > 0 {
Expand Down
2 changes: 1 addition & 1 deletion Aerial/Source/Models/ErrorLog.swift
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ func Log(level: ErrorLevel, message: String) {
if #available(OSX 10.12, *) {
// This is faster when available
let log = OSLog(subsystem: Bundle.main.bundleIdentifier!, category: "Screensaver")
os_log("AerialError: %@", log: log, type: .error, message)
os_log("AerialError: %{public}@", log: log, type: .error, message)
} else {
NSLog("AerialError: \(message)")
}
Expand Down
56 changes: 46 additions & 10 deletions Aerial/Source/Models/ManifestLoader.swift
Original file line number Diff line number Diff line change
Expand Up @@ -455,10 +455,10 @@ class ManifestLoader {
type: "video",
timeOfDay: asset.time,
url1080pH264: url1080p,
url1080pHEVC: "",
url1080pHDR: "",
url1080pHEVC: url1080p,
url1080pHDR: url1080p,
url4KHEVC: url4K,
url4KHDR: "",
url4KHDR: url4K,
manifest: .customVideos,
poi: [:],
communityPoi: asset.pointsOfInterest)
Expand Down Expand Up @@ -765,7 +765,7 @@ class ManifestLoader {
}
}
} catch {
errorLog("Error retrieving content listing")
errorLog("Error retrieving content listing (new)")
return
}
}
Expand Down Expand Up @@ -850,7 +850,7 @@ class ManifestLoader {
}
}
} catch {
errorLog("Error retrieving content listing")
errorLog("Error retrieving content listing (old)")
return
}
}
Expand Down Expand Up @@ -902,7 +902,7 @@ class ManifestLoader {
warnLog("We have no videos in the manifest")
return ("Can't estimate duplicates", 0)
}
guard let cacheDirectory = VideoCache.cacheDirectory else {
guard let cacheDirectory = VideoCache.appSupportDirectory else {
warnLog("No cache directory")
return ("Can't estimate duplicates", 0)
}
Expand All @@ -915,7 +915,7 @@ class ManifestLoader {
let directoryContent = try fileManager.contentsOfDirectory(at: cacheDirectoryUrl, includingPropertiesForKeys: nil)
let videoFileURLs = directoryContent.filter { $0.pathExtension == "mov" }

// We check the 3 fields
// We check the 5 fields
for fileURL in videoFileURLs {
var found = false
for video in loadedManifest {
Expand All @@ -931,12 +931,24 @@ class ManifestLoader {
break
}
}
if video.url1080pHDR != "" {
if fileURL.lastPathComponent == URL(string: video.url1080pHDR)?.lastPathComponent {
found = true
break
}
}
if video.url4KHEVC != "" {
if fileURL.lastPathComponent == URL(string: video.url4KHEVC)?.lastPathComponent {
found = true
break
}
}
if video.url4KHDR != "" {
if fileURL.lastPathComponent == URL(string: video.url4KHDR)?.lastPathComponent {
found = true
break
}
}
}

if !found {
Expand Down Expand Up @@ -992,7 +1004,7 @@ class ManifestLoader {
let directoryContent = try fileManager.contentsOfDirectory(at: cacheDirectoryUrl, includingPropertiesForKeys: nil)
let videoFileURLs = directoryContent.filter { $0.pathExtension == "mov" }

// We check the 3 fields
// We check the 5 fields
for fileURL in videoFileURLs {
var found = false
for video in loadedManifest {
Expand All @@ -1008,12 +1020,24 @@ class ManifestLoader {
break
}
}
if video.url1080pHDR != "" {
if fileURL.lastPathComponent == URL(string: video.url1080pHDR)?.lastPathComponent {
found = true
break
}
}
if video.url4KHEVC != "" {
if fileURL.lastPathComponent == URL(string: video.url4KHEVC)?.lastPathComponent {
found = true
break
}
}
if video.url4KHDR != "" {
if fileURL.lastPathComponent == URL(string: video.url4KHDR)?.lastPathComponent {
found = true
break
}
}
}

if !found {
Expand All @@ -1034,7 +1058,7 @@ class ManifestLoader {
// swiftlint:disable:next cyclomatic_complexity
func trashOldVideos() {
debugLog("trash old videos")
let cacheDirectory = VideoCache.cacheDirectory!
let cacheDirectory = VideoCache.appSupportDirectory!
var cacheResourcesString = cacheDirectory

let dateFormatter = DateFormatter()
Expand Down Expand Up @@ -1067,7 +1091,7 @@ class ManifestLoader {
let directoryContent = try fileManager.contentsOfDirectory(at: cacheDirectoryUrl, includingPropertiesForKeys: nil)
let videoFileURLs = directoryContent.filter { $0.pathExtension == "mov" }

// We check the 3 fields
// We check the 5 fields
for fileURL in videoFileURLs {
var found = false
for video in loadedManifest {
Expand All @@ -1083,12 +1107,24 @@ class ManifestLoader {
break
}
}
if video.url1080pHDR != "" {
if fileURL.lastPathComponent == URL(string: video.url1080pHDR)?.lastPathComponent {
found = true
break
}
}
if video.url4KHEVC != "" {
if fileURL.lastPathComponent == URL(string: video.url4KHEVC)?.lastPathComponent {
found = true
break
}
}
if video.url4KHDR != "" {
if fileURL.lastPathComponent == URL(string: video.url4KHDR)?.lastPathComponent {
found = true
break
}
}
}

if !found {
Expand Down
Loading

0 comments on commit f54de33

Please sign in to comment.