Skip to content

Commit

Permalink
Merge pull request #853 from glouel/master
Browse files Browse the repository at this point in the history
1.6.0
  • Loading branch information
glouel authored Sep 26, 2019
2 parents aad48d1 + 0380adf commit 1fa84f5
Show file tree
Hide file tree
Showing 11 changed files with 139 additions and 68 deletions.
10 changes: 6 additions & 4 deletions Aerial.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -995,6 +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;
PRODUCT_BUNDLE_IDENTIFIER = "com.johncoates.Aerial-Test";
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
Expand All @@ -1017,6 +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;
PRODUCT_BUNDLE_IDENTIFIER = "com.johncoates.Aerial-Test";
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
Expand Down Expand Up @@ -1183,15 +1185,15 @@
CODE_SIGN_IDENTITY = "Developer ID Application: Guillaume Louel (3L54M5L5KK)";
CODE_SIGN_STYLE = Manual;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 1.5.1beta13;
CURRENT_PROJECT_VERSION = 1.6.0;
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.5.1beta13;
MARKETING_VERSION = 1.6.0;
PRODUCT_BUNDLE_IDENTIFIER = com.johncoates.Aerial;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
Expand All @@ -1212,15 +1214,15 @@
CODE_SIGN_IDENTITY = "Developer ID Application: Guillaume Louel (3L54M5L5KK)";
CODE_SIGN_STYLE = Manual;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 1.5.1beta13;
CURRENT_PROJECT_VERSION = 1.6.0;
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.5.1beta13;
MARKETING_VERSION = 1.6.0;
OTHER_CODE_SIGN_FLAGS = "--timestamp";
PRODUCT_BUNDLE_IDENTIFIER = com.johncoates.Aerial;
PRODUCT_NAME = "$(TARGET_NAME)";
Expand Down
2 changes: 1 addition & 1 deletion Aerial/App/Resources/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.5.1beta1</string>
<string>$(MARKETING_VERSION)</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
Expand Down
7 changes: 0 additions & 7 deletions Aerial/Source/Controllers/PWC Tabs/PWC+Advanced.swift
Original file line number Diff line number Diff line change
Expand Up @@ -127,13 +127,6 @@ extension PreferencesWindowController {

}

@IBAction func checkForUpdatesButton(_ sender: Any) {
debugLog("check for updates")
sparkleUpdater!.checkForUpdates(self)

lastCheckedSparkle.stringValue = "Last checked today"
}

@IBAction func trashOldVideosClick(_ sender: Any) {
ManifestLoader.instance.trashOldVideos()

Expand Down
4 changes: 4 additions & 0 deletions Aerial/Source/Controllers/PWC Tabs/PWC+Cache.swift
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,10 @@ extension PreferencesWindowController {
NSWorkspace.shared.selectFile(nil, inFileViewerRootedAtPath: VideoCache.cacheDirectory!)
}

@IBAction func showAppSupportInFinder(_ sender: Any) {
NSWorkspace.shared.selectFile(nil, inFileViewerRootedAtPath: VideoCache.appSupportDirectory!)
}

@IBAction func userSetCacheLocation(_ button: NSButton?) {
if #available(OSX 10.15, *) {
// On Catalina, we can't use NSOpenPanel right now
Expand Down
13 changes: 12 additions & 1 deletion Aerial/Source/Controllers/PWC Tabs/PWC+Updates.swift
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ extension PreferencesWindowController {
betaCheckFrequencyPopup.isEnabled = true
}
}

// MARK: - Update panel
@IBAction func newVideosModeChange(_ sender: NSPopUpButton) {
debugLog("UI newVideosMode: \(sender.indexOfSelectedItem)")
Expand All @@ -53,6 +54,7 @@ extension PreferencesWindowController {
popoverUpdate.show(relativeTo: button.preparedContentRect, of: button, preferredEdge: .maxY)
}

// Sparkle updates
@IBAction func automaticallyCheckForUpdatesChange(_ button: NSButton) {
let onState = button.state == .on
sparkleUpdater!.automaticallyChecksForUpdates = onState
Expand Down Expand Up @@ -80,6 +82,14 @@ extension PreferencesWindowController {
}
}

@IBAction func checkForUpdatesButton(_ sender: Any) {
debugLog("check for updates")
sparkleUpdater!.checkForUpdates(self)

lastCheckedSparkle.stringValue = "Last checked today"
}

// Json updates
@IBAction func checkNowButtonClick(_ sender: NSButton) {
checkNowButton.isEnabled = false
ManifestLoader.instance.addCallback(reloadJSONCallback)
Expand All @@ -89,4 +99,5 @@ extension PreferencesWindowController {
func reloadJSONCallback(manifestVideos: [AerialVideo]) {
checkNowButton.isEnabled = true
lastCheckedVideosLabel.stringValue = "Last checked on " + preferences.lastVideoCheck!
}}
}
}
3 changes: 2 additions & 1 deletion Aerial/Source/Models/AerialVideo.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ import Foundation
import AVFoundation

enum Manifests: String {
case tvOS10 = "tvos10.json", tvOS11 = "tvos11.json", tvOS12 = "tvos12.json", tvOS13 = "tvos13.json", customVideos = "customvideos.json"
// swiftlint:disable:next line_length
case tvOS10 = "tvos10.json", tvOS11 = "tvos11.json", tvOS12 = "tvos12.json", tvOS13 = "tvos13.json", tvOS13Strings = "TVIdleScreenStrings13.bundle", customVideos = "customvideos.json"
}

private let spaceVideos = [
Expand Down
8 changes: 4 additions & 4 deletions Aerial/Source/Models/Cache/PoiStringProvider.swift
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,14 @@ final class PoiStringProvider {
var bundlePath = VideoCache.appSupportDirectory!
if preferences.ciOverrideLanguage == "" {
// We load the bundle and let system grab the closest available preferred language
bundlePath.append(contentsOf: "/TVIdleScreenStrings.bundle")
bundlePath.append(contentsOf: "/TVIdleScreenStrings13.bundle")
} else {
// Or we load the overriden one
bundlePath.append(contentsOf: "/TVIdleScreenStrings.bundle/" + preferences.ciOverrideLanguage! + ".lproj/")
bundlePath.append(contentsOf: "/TVIdleScreenStrings13.bundle/" + preferences.ciOverrideLanguage! + ".lproj/")
}

if let sb = Bundle.init(path: bundlePath) {
let dictPath = VideoCache.appSupportDirectory!.appending("/TVIdleScreenStrings.bundle/en.lproj/Localizable.nocache.strings")
let dictPath = VideoCache.appSupportDirectory!.appending("/TVIdleScreenStrings13.bundle/en.lproj/Localizable.nocache.strings")

// We could probably only work with that...
if let sd = NSDictionary(contentsOfFile: dictPath) as? [String: String] {
Expand All @@ -62,7 +62,7 @@ final class PoiStringProvider {
self.stringBundle = sb
self.loadedDescriptions = true
} else {
errorLog("TVIdleScreenStrings.bundle is missing, please remove entries.json in Cache folder to fix the issue")
errorLog("TVIdleScreenStrings13.bundle is missing, please remove entries.json in Cache folder to fix the issue")
}
}

Expand Down
9 changes: 9 additions & 0 deletions Aerial/Source/Models/Downloads/DownloadManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,15 @@ extension DownloadOperation: URLSessionTaskDelegate {
} catch let error as NSError {
debugLog("Error renaming tvos13.json: \(error)")
}

let bsrc = VideoCache.appSupportDirectory!.appending("/TVIdleScreenStrings.bundle")
let bdest = VideoCache.appSupportDirectory!.appending("/TVIdleScreenStrings13.bundle")

do {
try fileManager.moveItem(atPath: bsrc, toPath: bdest)
} catch let error as NSError {
debugLog("Error renaming TVIdleScreenStrings13.bundle: \(error)")
}
}

debugLog("Finished downloading \(task.originalRequest!.url!.absoluteString)")
Expand Down
32 changes: 20 additions & 12 deletions Aerial/Source/Models/ManifestLoader.swift
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ class ManifestLoader {
var urls: [URL] = []

// For tvOS12-13, json is now in a tar file
if !isManifestCached(manifest: .tvOS13) {
if !isManifestCached(manifest: .tvOS13) || !isManifestCached(manifest: .tvOS13Strings) {
urls.append(URL(string: "https://sylvan.apple.com/Aerials/resources-13.tar")!)
}

Expand Down Expand Up @@ -512,31 +512,39 @@ class ManifestLoader {
}
}

// tvOS < 12 sta
// We only backup the current tvos and TVStringsBundle (tvOS13)
// Previous versions don't change
func moveOldManifests() {
debugLog("move")
let cacheDirectory = VideoCache.appSupportDirectory!
var cacheResourcesString = cacheDirectory

// Generate the backup path
let dateFormatter = DateFormatter()
let current = Date()
dateFormatter.dateFormat = "yyyy-MM-dd"
let today = dateFormatter.string(from: current)

cacheResourcesString.append(contentsOf: "/backups/"+today)
let previous = URL(fileURLWithPath: cacheDirectory.appending("/tvos12.json"))
if FileManager.default.fileExists(atPath: cacheDirectory.appending("/tvos12.json")) {
let new = URL(fileURLWithPath: cacheResourcesString.appending("/tvos12.json"))

// The previous files we want to move
let previous = URL(fileURLWithPath: cacheDirectory.appending("/tvos13.json"))
let previousBnd = URL(fileURLWithPath: cacheDirectory.appending("/TVIdleScreenStrings13.bundle"))

// swiftlint:disable:next line_length
if FileManager.default.fileExists(atPath: cacheDirectory.appending("/tvos13.json")) || FileManager.default.fileExists(atPath: cacheDirectory.appending("/TVIdleScreenStrings13.bundle")) {
let new = URL(fileURLWithPath: cacheResourcesString.appending("/tvos13.json"))
let newBnd = URL(fileURLWithPath: cacheResourcesString.appending("/TVIdleScreenStrings13.bundle"))

let cacheUrl = URL(fileURLWithPath: cacheResourcesString)
if #available(OSX 10.11, *) {
if !cacheUrl.hasDirectoryPath {
do {
try FileManager.default.createDirectory(atPath: cacheResourcesString, withIntermediateDirectories: true, attributes: nil)
debugLog("creating dir \(cacheResourcesString)")
try FileManager.default.createDirectory(atPath: cacheResourcesString, withIntermediateDirectories: true, attributes: nil)

debugLog("moving tvos13.json and TVIdleScreenStrings13.bundle")
try FileManager.default.moveItem(at: previous, to: new)
debugLog("moving tvos12.json")
try FileManager.default.moveItem(at: previousBnd, to: newBnd)
} catch {
errorLog("\(error.localizedDescription)")
}
Expand All @@ -560,7 +568,7 @@ class ManifestLoader {

// Check if the Manifests are saved in our cache directory
func areManifestsCached() -> Bool {
return isManifestCached(manifest: .tvOS10) && isManifestCached(manifest: .tvOS11) && isManifestCached(manifest: .tvOS12) && isManifestCached(manifest: .tvOS13)
return isManifestCached(manifest: .tvOS10) && isManifestCached(manifest: .tvOS11) && isManifestCached(manifest: .tvOS12) && isManifestCached(manifest: .tvOS13) && isManifestCached(manifest: .tvOS13Strings)
}

// Check if a Manifest is saved in our cache directory
Expand Down Expand Up @@ -591,7 +599,7 @@ class ManifestLoader {
let ndata = try Data(contentsOf: cacheFileUrl)
manifestTvOS13 = ndata
} catch {
errorLog("Can't load tvos13.json from cached directory (tvOS12)")
errorLog("Can't load tvos13.json from cached directory")
}

// tvOS12
Expand All @@ -601,7 +609,7 @@ class ManifestLoader {
let ndata = try Data(contentsOf: cacheFileUrl)
manifestTvOS12 = ndata
} catch {
errorLog("Can't load tvos12.json from cached directory (tvOS12)")
errorLog("Can't load tvos12.json from cached directory")
}

// tvOS11
Expand Down Expand Up @@ -638,7 +646,7 @@ class ManifestLoader {
// Reset our array
processedVideos = []

if manifestTvOS12 != nil {
if manifestTvOS13 != nil {
// We start with the more recent one, it has more information (poi, etc)
readJSONFromData(manifestTvOS13!, manifest: .tvOS13)
} else {
Expand Down
24 changes: 18 additions & 6 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,21 +30,33 @@ You can see a list of contributors [here](https://github.com/JohnCoates/Aerial/g
Aerial now includes an auto-update mechanism using the [Sparkle open-source project](https://github.com/sparkle-project/Sparkle). You will need to download it manually the first time :

1. Quit **System Preferences**.
2. [Download the latest release of `Aerial.saver.zip`](https://github.com/JohnCoates/Aerial/releases/latest). Alternatively, you can try the latest beta version [following this link](https://github.com/JohnCoates/Aerial/releases). **(macOS Catalina users, you need the beta version, more information here : https://github.com/JohnCoates/Aerial/issues/801)**
2. [Download the latest release of `Aerial.saver.zip`](https://github.com/JohnCoates/Aerial/releases/latest).
3. Unzip the downloaded file (if you use Safari, it should already be done for you).
4. Double-click `Aerial.saver`; it will open in `System Preferences` > `Desktop & Screen Saver` and ask you if you want to install for all users or for your user only. Be aware that installing for all users will require a password at install **and each subsequent update, including auto-updates.** By default, Aerial will still share its video cache if you install multiple times on the same system for each user.

After installation, **if you are upgrading from a previous version**, we suggest you check your cache path settings as 1.6.0 includes some significant changes to prepare for macOS Catalina.

Need more information on install, setup, or uninstall ? Or want to install via homebrew ? Check our extended [instructions here](Documentation/Installation.md). Curious about auto-updates ? [Have a look here](Documentation/AutoUpdates.md).

## What's new in Aerial 1.5.0 (May 31 2019)?
## What's new in Aerial 1.6.0 (September 26 2019)?

- Support for the 15 new videos included in tvOS 13, including the ten new underwater seascape videos and five new ISS space videos.

![Capture d’écran 2019-09-26 à 15 29 20](https://user-images.githubusercontent.com/37544189/65692345-a9224600-e072-11e9-8c60-b0e0e546ad31.jpg)

- The HDR versions of videos can now be played by Aerial. This requires macOS 10.15 Catalina, please note that you will need to redownload the HDR versions of those videos.

![Capture d’écran 2019-09-26 à 15 26 34](https://user-images.githubusercontent.com/37544189/65692344-a889af80-e072-11e9-8eac-361ba1f5d980.jpg)

- Improved advanced multi monitor support. Advanced users can now finely specify the distance between each of their screens in the new "Spanned" mode included in Aerial 1.5.0, in order to accomodate more complex configurations.

- Completely rewritten multi monitor support. You can now enable and disable individual displays in the new Display tab. There is also a new "Spanned" viewing mode. Selecting this mode will span an Aerial video on all your (selected) screens. You can even adjust the margins between your screens:
![Capture d’écran 2019-09-26 à 15 24 08](https://user-images.githubusercontent.com/37544189/65692342-a889af80-e072-11e9-81ad-de70c7b2f0a1.jpg)

![Capture d’écran 2019-05-29 à 14 43 52](https://user-images.githubusercontent.com/37544189/58558342-d116af80-8220-11e9-8bb0-8d26f1e1b6ed.jpg)
- Support for macOS 10.15 Catalina. macOS Catalina includes new restrictions on third party screen savers, which impact some of the functionnalities. We highly suggest that current and would be Catalina users check this issue for more information on those restrictions : https://github.com/JohnCoates/Aerial/issues/801

- You can now add your own videos to Aerial using the new [Custom Videos feature](Documentation/CustomVideos.md), and play them alongside Aerial videos:
![Capture d’écran 2019-09-26 à 15 23 45](https://user-images.githubusercontent.com/37544189/65692340-a889af80-e072-11e9-8109-cdcd8f55fe86.jpg)

![Capture d’écran 2019-05-30 à 18 01 36](https://user-images.githubusercontent.com/37544189/58646171-24fac480-8305-11e9-98fd-c9ec7ef3a64c.jpg)
Aerial is also now properly signed and notarized to comply with new restrictions introduced in macOS 10.15 Catalina.

You can find more about [version changes here](Documentation/ChangeLog.md).

Expand Down
Loading

0 comments on commit 1fa84f5

Please sign in to comment.