diff --git a/Aerial.xcodeproj/project.pbxproj b/Aerial.xcodeproj/project.pbxproj index c610575f..76834896 100644 --- a/Aerial.xcodeproj/project.pbxproj +++ b/Aerial.xcodeproj/project.pbxproj @@ -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.3; + MARKETING_VERSION = 1.6.4; PRODUCT_BUNDLE_IDENTIFIER = "com.johncoates.Aerial-Test"; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; @@ -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.3; + MARKETING_VERSION = 1.6.4; PRODUCT_BUNDLE_IDENTIFIER = "com.johncoates.Aerial-Test"; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; @@ -1185,7 +1185,7 @@ CODE_SIGN_IDENTITY = "Developer ID Application: Guillaume Louel (3L54M5L5KK)"; CODE_SIGN_STYLE = Manual; COMBINE_HIDPI_IMAGES = YES; - CURRENT_PROJECT_VERSION = 1.6.3; + CURRENT_PROJECT_VERSION = 1.6.4; DEFINES_MODULE = YES; DEVELOPMENT_TEAM = 3L54M5L5KK; ENABLE_HARDENED_RUNTIME = YES; @@ -1193,7 +1193,7 @@ 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.3; + MARKETING_VERSION = 1.6.4; PRODUCT_BUNDLE_IDENTIFIER = com.johncoates.Aerial; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; @@ -1214,7 +1214,7 @@ CODE_SIGN_IDENTITY = "Developer ID Application: Guillaume Louel (3L54M5L5KK)"; CODE_SIGN_STYLE = Manual; COMBINE_HIDPI_IMAGES = YES; - CURRENT_PROJECT_VERSION = 1.6.3; + CURRENT_PROJECT_VERSION = 1.6.4; DEFINES_MODULE = YES; DEVELOPMENT_TEAM = 3L54M5L5KK; ENABLE_HARDENED_RUNTIME = YES; @@ -1222,7 +1222,7 @@ 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.3; + MARKETING_VERSION = 1.6.4; OTHER_CODE_SIGN_FLAGS = "--timestamp"; PRODUCT_BUNDLE_IDENTIFIER = com.johncoates.Aerial; PRODUCT_NAME = "$(TARGET_NAME)"; diff --git a/Aerial/Source/Controllers/PreferencesWindowController.swift b/Aerial/Source/Controllers/PreferencesWindowController.swift index 757b6a23..641b6ac1 100644 --- a/Aerial/Source/Controllers/PreferencesWindowController.swift +++ b/Aerial/Source/Controllers/PreferencesWindowController.swift @@ -501,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 { diff --git a/Aerial/Source/Models/ManifestLoader.swift b/Aerial/Source/Models/ManifestLoader.swift index 84d74e42..ea0fdf50 100644 --- a/Aerial/Source/Models/ManifestLoader.swift +++ b/Aerial/Source/Models/ManifestLoader.swift @@ -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) } @@ -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 { @@ -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 { @@ -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 { @@ -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 { @@ -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() @@ -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 { @@ -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 {