-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1545 from NYPL-Simplified/release/simplye/3.8.5
Merge SimplyE 3.8.5 to master
- Loading branch information
Showing
33 changed files
with
220 additions
and
101 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule Axis-iOS
updated
from 77d18d to 3c4ced
Submodule Certificates
updated
from 7c9533 to 7e25a2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
source "https://rubygems.org" | ||
|
||
gem "fastlane" | ||
gem "fastlane", "2.205.0" | ||
|
Submodule NYPLAEToolkit
updated
from c2420f to bc41a7
Submodule NYPLAudiobookToolkit
updated
2 files
+26 −1 | NYPLAudiobookToolkit/Core/AudiobookManager.swift | |
+1 −1 | Package.resolved |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
55 changes: 55 additions & 0 deletions
55
Simplified/Book/UI/NYPLBookCellDelegate+AudiobookProgressSaving.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
// | ||
// NYPLBookCellDelegate+AudiobookProgressSaving.swift | ||
// Simplified | ||
// | ||
// Created by Ernest Fan on 2022-03-01. | ||
// Copyright © 2022 NYPL. All rights reserved. | ||
// | ||
#if FEATURE_AUDIOBOOKS | ||
import Foundation | ||
import NYPLAudiobookToolkit | ||
import UIKit | ||
import NYPLUtilities | ||
|
||
private let NYPLAudiobookProgressSavingInterval: DispatchTimeInterval = .seconds(60) | ||
|
||
@objc extension NYPLBookCellDelegate { | ||
|
||
private func savePosition() { | ||
NYPLBookRegistry.shared().save() | ||
} | ||
|
||
// Create a timer that saves the audiobook progress periodically when the app is inactive. | ||
// We do save the progress when app is being killed and applicationWillTerminate: is called, | ||
// but applicationWillTerminate: is not always called when users force quit the app. | ||
// This method is triggered when app resigns active. | ||
@objc(scheduleProgressSavingTimerForAudiobookManager:) | ||
func scheduleProgressSavingTimer(for manager: DefaultAudiobookManager?) { | ||
guard let manager = manager else { | ||
return | ||
} | ||
|
||
weak var weakManager = manager | ||
|
||
let timer = NYPLRepeatingTimer(interval: NYPLAudiobookProgressSavingInterval, | ||
queue: self.audiobookProgressSavingQueue) { [weak self] in | ||
var isActive = false | ||
|
||
NYPLMainThreadRun.sync { | ||
isActive = UIApplication.shared.applicationState == .active | ||
} | ||
|
||
if isActive { | ||
// DispatchSourceTimer will automatically cancel the timer if it is released. | ||
weakManager?.cancelProgressSavingTimer() | ||
} else { | ||
if let manager = weakManager, | ||
!manager.progressSavingTimerIsNil() { | ||
self?.savePosition() | ||
} | ||
} | ||
} | ||
manager.setProgressSavingTimer(timer) | ||
} | ||
} | ||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.