Skip to content

Commit

Permalink
3.5.2beta2
Browse files Browse the repository at this point in the history
  • Loading branch information
glouel committed Nov 9, 2024
1 parent 6b0f608 commit 18b794f
Show file tree
Hide file tree
Showing 17 changed files with 158 additions and 79 deletions.
16 changes: 8 additions & 8 deletions Aerial.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -3058,7 +3058,7 @@
ENABLE_TESTABILITY = YES;
INFOPLIST_FILE = Aerial/App/Resources/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks";
MACOSX_DEPLOYMENT_TARGET = 10.13;
MACOSX_DEPLOYMENT_TARGET = 10.14;
MARKETING_VERSION = 2.1.4beta1.appmode;
PRODUCT_BUNDLE_IDENTIFIER = "com.johncoates.Aerial-Test";
PRODUCT_NAME = "$(TARGET_NAME)";
Expand All @@ -3081,7 +3081,7 @@
ENABLE_TESTABILITY = YES;
INFOPLIST_FILE = Aerial/App/Resources/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks";
MACOSX_DEPLOYMENT_TARGET = 10.13;
MACOSX_DEPLOYMENT_TARGET = 10.14;
MARKETING_VERSION = 2.1.4beta1.appmode;
PRODUCT_BUNDLE_IDENTIFIER = "com.johncoates.Aerial-Test";
PRODUCT_NAME = "$(TARGET_NAME)";
Expand Down Expand Up @@ -3249,15 +3249,15 @@
CODE_SIGN_IDENTITY = "Developer ID Application";
CODE_SIGN_STYLE = Manual;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 3.3.7;
CURRENT_PROJECT_VERSION = 3.5.2beta1;
DEFINES_MODULE = YES;
DEVELOPMENT_TEAM = 3L54M5L5KK;
ENABLE_HARDENED_RUNTIME = YES;
INFOPLIST_FILE = "$(SRCROOT)/Resources/Old stuff/Info.plist";
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.3.7;
MACOSX_DEPLOYMENT_TARGET = 10.14;
MARKETING_VERSION = 3.5.2beta1;
PRODUCT_BUNDLE_IDENTIFIER = com.johncoates.Aerial;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
Expand All @@ -3278,15 +3278,15 @@
CODE_SIGN_IDENTITY = "Developer ID Application";
CODE_SIGN_STYLE = Manual;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 3.3.7;
CURRENT_PROJECT_VERSION = 3.5.2beta1;
DEFINES_MODULE = YES;
DEVELOPMENT_TEAM = 3L54M5L5KK;
ENABLE_HARDENED_RUNTIME = YES;
INFOPLIST_FILE = "$(SRCROOT)/Resources/Old stuff/Info.plist";
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.3.7;
MACOSX_DEPLOYMENT_TARGET = 10.14;
MARKETING_VERSION = 3.5.2beta1;
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/Models/API/Forecast.swift
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ struct Forecast {
}

static func makeUrl(lat: String, lon: String) -> String {
return "http://api.openweathermap.org/data/2.5/forecast"
return "https://api.openweathermap.org/data/2.5/forecast"
+ "?lat=\(lat)&lon=\(lon)"
+ "&units=\(getUnits())"
+ "&lang=\(getShortcodeLanguage())"
Expand All @@ -150,7 +150,7 @@ struct Forecast {
static func makeUrl(location: String) -> String {
let nloc = location.addingPercentEncoding(withAllowedCharacters: .urlQueryAllowed)!

return "http://api.openweathermap.org/data/2.5/forecast"
return "https://api.openweathermap.org/data/2.5/forecast"
+ "?q=\(nloc)"
+ "&units=\(getUnits())"
+ "&lang=\(getShortcodeLanguage())"
Expand Down
2 changes: 1 addition & 1 deletion Aerial/Source/Models/API/GeoCoding.swift
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ struct GeoCoding {

static func makeUrl() -> String {
let nloc = PrefsInfo.weather.locationString.addingPercentEncoding(withAllowedCharacters: .urlQueryAllowed)!
return "http://api.openweathermap.org/geo/1.0/direct"
return "https://api.openweathermap.org/geo/1.0/direct"
+ "?q=\(nloc)"
+ "&appid=\(APISecrets.openWeatherAppId)"
}
Expand Down
4 changes: 2 additions & 2 deletions Aerial/Source/Models/API/OneCall.swift
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ struct OneCall {
}

static func makeUrl(lat: String, lon: String) -> String {
return "http://api.openweathermap.org/data/2.5/onecall"
return "https://api.openweathermap.org/data/2.5/onecall"
+ "?lat=\(lat)&lon=\(lon)"
+ "&units=\(getUnits())"
+ "&lang=\(getShortcodeLanguage())"
Expand All @@ -182,7 +182,7 @@ struct OneCall {
let nloc = location.addingPercentEncoding(withAllowedCharacters: .urlQueryAllowed)!
return "http://api.openweathermap.org/data/2.5/onecall"
return "https://api.openweathermap.org/data/2.5/onecall"
+ "?q=\(nloc)"
+ "&units=\(getUnits())"
+ "&lang=\(getShortcodeLanguage())"
Expand Down
4 changes: 2 additions & 2 deletions Aerial/Source/Models/API/OpenWeather.swift
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ struct OpenWeather {
}

static func makeUrl(lat: String, lon: String) -> String {
return "http://api.openweathermap.org/data/2.5/weather"
return "https://api.openweathermap.org/data/2.5/weather"
+ "?lat=\(lat)&lon=\(lon)"
+ "&units=\(getUnits())"
+ "&lang=\(getShortcodeLanguage())"
Expand All @@ -145,7 +145,7 @@ struct OpenWeather {
static func makeUrl(location: String) -> String {
let nloc = location.addingPercentEncoding(withAllowedCharacters: .urlQueryAllowed)!

return "http://api.openweathermap.org/data/2.5/weather"
return "https://api.openweathermap.org/data/2.5/weather"
+ "?q=\(nloc)"
+ "&units=\(getUnits())"
+ "&lang=\(getShortcodeLanguage())"
Expand Down
3 changes: 3 additions & 0 deletions Aerial/Source/Models/AerialVideo.swift
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,9 @@ final class AerialVideo: CustomStringConvertible, Equatable {
updateDuration() // We need to have the video duration
}




func updateDuration() {
// We need to retrieve video duration from the cached files.
// This is a workaround as currently, the VideoCache infrastructure
Expand Down
2 changes: 1 addition & 1 deletion Aerial/Source/Models/Cache/PoiStringProvider.swift
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ final class PoiStringProvider {

private func loadBundle() {
// Idle string bundle
var bundlePath = Cache.supportPath.appending("/macOS 14")
var bundlePath = Cache.supportPath.appending("/macOS 15")

if PrefsAdvanced.ciOverrideLanguage == "" {
debugLog("Preferred languages : \(Locale.preferredLanguages)")
Expand Down
53 changes: 50 additions & 3 deletions Aerial/Source/Models/Cache/VideoCache.swift
Original file line number Diff line number Diff line change
Expand Up @@ -145,18 +145,65 @@ final class VideoCache {
let fileManager = FileManager.default

if video.url.absoluteString.starts(with: "file") {
return fileManager.fileExists(atPath: video.url.path)
if fileManager.fileExists(atPath: video.url.path) {
do {
let resourceValues = try video.url.resourceValues(forKeys: [.fileSizeKey])
let fileSize = resourceValues.fileSize!

// Make sure the file is big enough to be a video and not some network failure
if fileSize > 500000 {
return true
}
} catch {
errorLog("File check throw")
}

return false
} else {
return false
}
} else {
if video.source.isCachable {
guard let videoCachePath = cachePath(forVideo: video) else {
errorLog("Couldn't get video cache path!")
return false
}

return fileManager.fileExists(atPath: videoCachePath)
if fileManager.fileExists(atPath: videoCachePath) {
do {
let fileUrl = Foundation.URL(fileURLWithPath: videoCachePath)


let resourceValues = try fileUrl.resourceValues(forKeys: [.fileSizeKey])
let fileSize = resourceValues.fileSize!

// Make sure the file is big enough to be a video and not some network failure
if fileSize > 500000 {
return true
}

} catch {
errorLog("File check throw")
}
}

return false
} else {
let path = sourcePathFor(video)
return fileManager.fileExists(atPath: path)
do {
let fileUrl = Foundation.URL(fileURLWithPath: path)
let resourceValues = try fileUrl.resourceValues(forKeys: [.fileSizeKey])
let fileSize = resourceValues.fileSize!

// Make sure the file is big enough to be a video and not some network failure
if fileSize > 500000 {
return true
}

} catch {
errorLog("File check throw")
}
return false
}
}
}
Expand Down
2 changes: 2 additions & 0 deletions Aerial/Source/Models/Downloads/DownloadManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,8 @@ extension DownloadOperation: URLSessionTaskDelegate {
FileHelpers.unTar(file: destinationDirectory.appending("/resources.tar"), atPath: destinationDirectory)
} else if folder == "macOS 14" {
FileHelpers.unTar(file: destinationDirectory.appending("/resources-14-0-10.tar"), atPath: destinationDirectory)
} else if folder == "macOS 15" {
FileHelpers.unTar(file: destinationDirectory.appending("/resources-15-0-2.tar"), atPath: destinationDirectory)
}

debugLog("Finished downloading \(task.originalRequest!.url!.absoluteString)")
Expand Down
104 changes: 63 additions & 41 deletions Aerial/Source/Models/Sources/SourceList.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,24 @@ struct SourceHeader {
// swiftlint:disable:next type_body_length
struct SourceList {
// This is the current one until next fall
static let macOS14 = Source(name: "macOS 14",
static let macOS15 = Source(name: "macOS 15",
description: "High framerate videos from macOS 15 Sequoia",
manifestUrl: "https://sylvan.apple.com/itunes-assets/Aerials126/v4/82/2e/34/822e344c-f5d2-878c-3d56-508d5b09ed61/resources-15-0-2.tar",
type: .macOS,
scenes: [.nature, .city, .space, .sea],
isCachable: true,
license: "",
more: "")

// This is the current one until next fall
/*static let macOS14 = Source(name: "macOS 14",
description: "High framerate videos from macOS 14 Sonoma",
manifestUrl: "https://sylvan.apple.com/itunes-assets/Aerials126/v4/82/2e/34/822e344c-f5d2-878c-3d56-508d5b09ed61/resources-14-0-10.tar",
type: .macOS,
scenes: [.nature, .city, .space, .sea],
isCachable: true,
license: "",
more: "")
more: "")*/

// This is the current one until next fall
static let tvOS16 = Source(name: "tvOS 16",
Expand Down Expand Up @@ -72,7 +82,7 @@ struct SourceList {
license: "",
more: "")*/

static var list: [Source] = [macOS14, tvOS16, tvOS13] + foundSources
static var list: [Source] = [macOS15, tvOS16, tvOS13] + foundSources
// static var list: [Source] = foundSources

// This is where the magic happens
Expand Down Expand Up @@ -251,30 +261,36 @@ struct SourceList {

for lurl in urls {
if lurl.path.lowercased().hasSuffix(".mp4") || lurl.path.lowercased().hasSuffix(".mov") {

let resourceValues = try lurl.resourceValues(forKeys: [.fileSizeKey])
let fileSize = resourceValues.fileSize!

if fileSize > 500000 {
// Check if the asset was there previously
let foundAssets = originalAssets.filter { $0.url4KSDR == lurl.path }

if let foundAsset = foundAssets.first {
// Just add the asset to the new array
updatedAssets.append(foundAsset)
} else {
// Create a new entry
updatedAssets.append(VideoAsset(accessibilityLabel: folderName,
id: NSUUID().uuidString,
title: lurl.lastPathComponent,
timeOfDay: "day",
scene: "",
pointsOfInterest: [:],
url4KHDR: "",
url4KSDR: lurl.path,
url1080H264: "",
url1080HDR: "",
url4KSDR120FPS: "",
url4KSDR240FPS: "",
url1080SDR: "",
url: "",
type: "nature"))
}

// Check if the asset was there previously
let foundAssets = originalAssets.filter { $0.url4KSDR == lurl.path }

if let foundAsset = foundAssets.first {
// Just add the asset to the new array
updatedAssets.append(foundAsset)
} else {
// Create a new entry
updatedAssets.append(VideoAsset(accessibilityLabel: folderName,
id: NSUUID().uuidString,
title: lurl.lastPathComponent,
timeOfDay: "day",
scene: "",
pointsOfInterest: [:],
url4KHDR: "",
url4KSDR: lurl.path,
url1080H264: "",
url1080HDR: "",
url4KSDR120FPS: "",
url4KSDR240FPS: "",
url1080SDR: "",
url: "",
type: "nature"))
}
}
}
Expand Down Expand Up @@ -307,21 +323,27 @@ struct SourceList {

for lurl in urls {
if lurl.path.lowercased().hasSuffix(".mp4") || lurl.path.lowercased().hasSuffix(".mov") {
assets.append(VideoAsset(accessibilityLabel: folderName,
id: NSUUID().uuidString,
title: lurl.lastPathComponent,
timeOfDay: "day",
scene: "",
pointsOfInterest: [:],
url4KHDR: "",
url4KSDR: lurl.path,
url1080H264: "",
url1080HDR: "",
url4KSDR120FPS: "",
url4KSDR240FPS: "",
url1080SDR: "",
url: "",
type: "nature"))

let resourceValues = try lurl.resourceValues(forKeys: [.fileSizeKey])
let fileSize = resourceValues.fileSize!

if fileSize > 500000 {
assets.append(VideoAsset(accessibilityLabel: folderName,
id: NSUUID().uuidString,
title: lurl.lastPathComponent,
timeOfDay: "day",
scene: "",
pointsOfInterest: [:],
url4KHDR: "",
url4KSDR: lurl.path,
url1080H264: "",
url1080HDR: "",
url4KSDR120FPS: "",
url4KSDR240FPS: "",
url1080SDR: "",
url: "",
type: "nature"))
}
}
}

Expand Down
6 changes: 5 additions & 1 deletion Aerial/Source/Views/AerialView+Player.swift
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,11 @@ extension AerialView {
1-(AerialView.fadeDuration/(video.duration/playbackSpeed)), 1 ] as [NSNumber]

fadeAnimation.duration = video.duration/playbackSpeed
fadeAnimation.calculationMode = CAAnimationCalculationMode.cubic
if #available(macOS 10.14, *) {
fadeAnimation.calculationMode = CAAnimationCalculationMode.cubic
} else {
// Fallback on earlier versions
}
view.playerLayer.add(fadeAnimation, forKey: "mainfade")
} else {
view.playerLayer.opacity = 1.0
Expand Down
8 changes: 4 additions & 4 deletions Aerial/Source/Views/AerialView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -464,12 +464,12 @@ final class AerialView: ScreenSaverView, CAAnimationDelegate {
}

if !isDisabled {
if let layer = layer {
layer.contentsScale = (self.window?.backingScaleFactor) ?? 1.0
self.playerLayer.contentsScale = (self.window?.backingScaleFactor) ?? 1.0
if let layer = layer, let window = self.window {
layer.contentsScale = (window.backingScaleFactor) ?? 1.0
self.playerLayer.contentsScale = (window.backingScaleFactor) ?? 1.0

// And our additional layers
layerManager.setContentScale(scale: (self.window?.backingScaleFactor) ?? 1.0)
layerManager.setContentScale(scale: (window.backingScaleFactor) ?? 1.0)
}
}
}
Expand Down
Loading

0 comments on commit 18b794f

Please sign in to comment.