Skip to content
This repository has been archived by the owner on Jul 23, 2024. It is now read-only.

Commit

Permalink
Merge pull request #615 from razeware/development
Browse files Browse the repository at this point in the history
  • Loading branch information
JessyCatterwaul authored Oct 25, 2021
2 parents c5f1e66 + dc6a7db commit 492b08c
Show file tree
Hide file tree
Showing 177 changed files with 1,992 additions and 1,471 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/appstore-upload.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ on:
jobs:
build:

runs-on: macOS-latest
runs-on: macos-11

steps:
- uses: actions/checkout@v1
- name: Switch to Xcode 12.4
run: sudo xcode-select --switch /Applications/Xcode_12.4.app
- name: Switch to Xcode 13.0
run: sudo xcode-select -s /Applications/Xcode_13.0.app
- name: Update fastlane
run: |
cd Emitron
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/run_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ on:

jobs:
build:
runs-on: macos-latest
runs-on: macos-11
steps:
- uses: actions/checkout@v1
- name: Switch to Xcode 12.4
run: sudo xcode-select -s /Applications/Xcode_12.4.app
- name: Switch to Xcode 13.0
run: sudo xcode-select -s /Applications/Xcode_13.0.app
- name: Update fastlane
run: |
cd Emitron
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/swiftlint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:

jobs:
SwiftLint:
runs-on: macos-latest
runs-on: macos-11
steps:
- uses: actions/checkout@v1

Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/testflight-beta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ on:
jobs:
build:

runs-on: macOS-latest
runs-on: macos-11

steps:
- uses: actions/checkout@v1
- name: Switch to Xcode 12.4
run: sudo xcode-select --switch /Applications/Xcode_12.4.app
- name: Switch to Xcode 13.0
run: sudo xcode-select -s /Applications/Xcode_13.0.app
- name: Update fastlane
run: |
cd Emitron
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/testflight-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ on:
jobs:
build:

runs-on: macOS-latest
runs-on: macos-11

steps:
- uses: actions/checkout@v1
- name: Switch to Xcode 12.4
run: sudo xcode-select --switch /Applications/Xcode_12.4.app
- name: Switch to Xcode 13.0
run: sudo xcode-select -s /Applications/Xcode_13.0.app
- name: Update fastlane
run: |
cd Emitron
Expand Down
106 changes: 45 additions & 61 deletions Emitron/Emitron.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -6,44 +6,35 @@
"repositoryURL": "https://github.com/groue/CombineExpectations.git",
"state": {
"branch": null,
"revision": "96d5604151c94b21fbca6877b237e80af9e821dd",
"version": "0.5.0"
"revision": "04d4e4b21c9e8361925f03f64a7ecda89ef9974f",
"version": "0.10.0"
}
},
{
"package": "GRDB",
"repositoryURL": "https://github.com/groue/GRDB.swift.git",
"state": {
"branch": null,
"revision": "5ee47c3c2765bdfde0f44c2ea9a263f6aa252d63",
"version": "4.14.0"
}
},
{
"package": "GRDBCombine",
"repositoryURL": "https://github.com/groue/GRDBCombine",
"state": {
"branch": null,
"revision": "cbae47a79921fb8df318f31b9c51f9a1245373e6",
"version": "0.8.1"
"revision": "32b2923e890df320906e64cbd0faca22a8bfda14",
"version": "5.12.0"
}
},
{
"package": "KeychainSwift",
"repositoryURL": "https://github.com/evgenyneu/keychain-swift",
"state": {
"branch": null,
"revision": "d9b76fba09c2eb5c0bb9312092d309c833996cd2",
"version": "18.0.0"
"revision": "96fb84f45a96630e7583903bd7e08cf095c7a7ef",
"version": "19.0.0"
}
},
{
"package": "Kingfisher",
"repositoryURL": "https://github.com/onevcat/Kingfisher",
"state": {
"branch": null,
"revision": "1a0c2df04b31ed7aa318354f3583faea24f006fc",
"version": "5.15.8"
"revision": "318e319998bf555c3e914d5c3adb6da05af86a32",
"version": "7.1.1"
}
},
{
Expand Down
107 changes: 5 additions & 102 deletions Emitron/Emitron/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -30,120 +30,23 @@ import UIKit
import AVFoundation
import GRDB

// swiftlint:disable strict_fileprivate

@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
private var persistenceStore: PersistenceStore!
private var guardpost: Guardpost!
fileprivate var dataManager: DataManager!
fileprivate var sessionController: SessionController!
fileprivate var downloadService: DownloadService!
fileprivate var messageBus = MessageBus()
fileprivate var settingsManager: SettingsManager!
fileprivate var iconManager = IconManager()

func applicationDidFinishLaunching(_ application: UIApplication) {
// Override point for customization after application launch.
var downloadService: DownloadService?

func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? = nil) -> Bool {
let audioSession = AVAudioSession.sharedInstance()
do {
try audioSession.setCategory(AVAudioSession.Category.playback)
} catch {
print("Setting category to AVAudioSessionCategoryPlayback failed.")
}

// Initialise the database
// swiftlint:disable:next force_try
let dbPool = try! setupDatabase(application)
persistenceStore = PersistenceStore(db: dbPool)
guardpost = Guardpost(baseURL: "https://accounts.raywenderlich.com",
urlScheme: "com.razeware.emitron://",
ssoSecret: Configuration.ssoSecret,
persistenceStore: persistenceStore)

sessionController = SessionController(guardpost: guardpost)
settingsManager = SettingsManager(
userDefaults: .standard,
userModelController: sessionController
)
downloadService = DownloadService(
persistenceStore: persistenceStore,
userModelController: sessionController
)
dataManager = DataManager(
sessionController: sessionController,
persistenceStore: persistenceStore,
downloadService: downloadService
)
downloadService.startProcessing()
}

// MARK: UISceneSession Lifecycle
func application(_ application: UIApplication,
configurationForConnecting connectingSceneSession: UISceneSession,
options: UIScene.ConnectionOptions) -> UISceneConfiguration {
// Called when a new scene session is being created.
// Use this method to select a configuration to create the new scene with.
return UISceneConfiguration(name: "Default Configuration",
sessionRole: connectingSceneSession.role)
}

func application(_ application: UIApplication,
didDiscardSceneSessions sceneSessions: Set<UISceneSession>) {
// Called when the user discards a scene session.
// If any sessions were discarded while the application was not running, this will be called shortly after application:didFinishLaunchingWithOptions.
// Use this method to release any resources that were specific to the discarded scenes, as they will not return.
return true
}

// For dealing with downloading of videos in the background
func application(_ application: UIApplication, handleEventsForBackgroundURLSession identifier: String, completionHandler: @escaping () -> Void) {
assert(identifier == DownloadProcessor.sessionIdentifier, "Unknown Background URLSession. Unable to handle these events.")

downloadService.backgroundSessionCompletionHandler = completionHandler
}

private func setupDatabase(_ application: UIApplication) throws -> DatabasePool {
let databaseURL = try FileManager.default
.url(for: .applicationSupportDirectory, in: .userDomainMask, appropriateFor: nil, create: true)
.appendingPathComponent("emitron.sqlite")
return try EmitronDatabase.openDatabase(atPath: databaseURL.path)
}
}

// MARK: - Making some delightful global-access points. Classy.
extension SessionController {
static var current: SessionController {
(UIApplication.shared.delegate as! AppDelegate).sessionController
}
}

extension DataManager {
static var current: DataManager {
(UIApplication.shared.delegate as! AppDelegate).dataManager
}
}

extension DownloadService {
static var current: DownloadService {
(UIApplication.shared.delegate as! AppDelegate).downloadService
}
}

extension MessageBus {
static var current: MessageBus {
(UIApplication.shared.delegate as! AppDelegate).messageBus
}
}

extension SettingsManager {
static var current: SettingsManager {
(UIApplication.shared.delegate as! AppDelegate).settingsManager
}
}

extension IconManager {
static var current: IconManager {
(UIApplication.shared.delegate as! AppDelegate).iconManager
downloadService?.backgroundSessionCompletionHandler = completionHandler
}
}
6 changes: 3 additions & 3 deletions Emitron/Emitron/Assets.xcassets/Contents.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"info" : {
"version" : 1,
"author" : "xcode"
"author" : "xcode",
"version" : 1
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
{
"images" : [
{
"filename" : "bookmarks-empty-state.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"appearances" : [
{
"appearance" : "luminosity",
"value" : "dark"
}
],
"filename" : "bookmarks-empty-state-1.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "[email protected]",
"idiom" : "universal",
"scale" : "2x"
},
{
"appearances" : [
{
"appearance" : "luminosity",
"value" : "dark"
}
],
"filename" : "[email protected]",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "[email protected]",
"idiom" : "universal",
"scale" : "3x"
},
{
"appearances" : [
{
"appearance" : "luminosity",
"value" : "dark"
}
],
"filename" : "[email protected]",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
{
"images" : [
{
"filename" : "completed-empty-state-1.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"appearances" : [
{
"appearance" : "luminosity",
"value" : "dark"
}
],
"filename" : "completed-empty-state.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "[email protected]",
"idiom" : "universal",
"scale" : "2x"
},
{
"appearances" : [
{
"appearance" : "luminosity",
"value" : "dark"
}
],
"filename" : "[email protected]",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "[email protected]",
"idiom" : "universal",
"scale" : "3x"
},
{
"appearances" : [
{
"appearance" : "luminosity",
"value" : "dark"
}
],
"filename" : "[email protected]",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions Emitron/Emitron/Assets.xcassets/Illustrations/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"info" : {
"author" : "xcode",
"version" : 1
}
}
Loading

0 comments on commit 492b08c

Please sign in to comment.