Skip to content

Commit

Permalink
1.6.4
Browse files Browse the repository at this point in the history
Fix old files estimation, move/trash old videos features that would always delete HDR files, and would look in the wrong folder in Catalina.
  • Loading branch information
glouel committed Nov 1, 2019
1 parent e50ca6e commit f41e909
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 11 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.3;
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.3;
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.3;
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.3;
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.3;
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.3;
MARKETING_VERSION = 1.6.4;
OTHER_CODE_SIGN_FLAGS = "--timestamp";
PRODUCT_BUNDLE_IDENTIFIER = com.johncoates.Aerial;
PRODUCT_NAME = "$(TARGET_NAME)";
Expand Down
2 changes: 2 additions & 0 deletions Aerial/Source/Controllers/PreferencesWindowController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
46 changes: 41 additions & 5 deletions Aerial/Source/Models/ManifestLoader.swift
Original file line number Diff line number Diff line change
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

0 comments on commit f41e909

Please sign in to comment.