mirror of
https://github.com/advplyr/audiobookshelf-app.git
synced 2026-08-30 15:17:14 +02:00
iOS Update Realm schema version for new setting, update remote transport controls on device settings updated
This commit is contained in:
@@ -14,7 +14,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
|
|||||||
// Override point for customization after application launch.
|
// Override point for customization after application launch.
|
||||||
|
|
||||||
let configuration = Realm.Configuration(
|
let configuration = Realm.Configuration(
|
||||||
schemaVersion: 16,
|
schemaVersion: 17,
|
||||||
migrationBlock: { [weak self] migration, oldSchemaVersion in
|
migrationBlock: { [weak self] migration, oldSchemaVersion in
|
||||||
if (oldSchemaVersion < 1) {
|
if (oldSchemaVersion < 1) {
|
||||||
self?.logger.log("Realm schema version was \(oldSchemaVersion)")
|
self?.logger.log("Realm schema version was \(oldSchemaVersion)")
|
||||||
|
|||||||
@@ -256,7 +256,9 @@ public class AbsDatabase: CAPPlugin {
|
|||||||
|
|
||||||
Database.shared.setDeviceSettings(deviceSettings: settings)
|
Database.shared.setDeviceSettings(deviceSettings: settings)
|
||||||
|
|
||||||
// call.resolve([ "value": [] ])
|
// Updates the media notification controls (for allowSeekingOnMediaControls setting)
|
||||||
|
PlayerHandler.updateRemoteTransportControls()
|
||||||
|
|
||||||
getDeviceData(call)
|
getDeviceData(call)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -588,7 +588,7 @@ class AudioPlayer: NSObject {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// MARK: - Now playing
|
// MARK: - Now playing
|
||||||
private func setupRemoteTransportControls() {
|
func setupRemoteTransportControls() {
|
||||||
DispatchQueue.runOnMainQueue {
|
DispatchQueue.runOnMainQueue {
|
||||||
UIApplication.shared.beginReceivingRemoteControlEvents()
|
UIApplication.shared.beginReceivingRemoteControlEvents()
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -135,6 +135,10 @@ class PlayerHandler {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static func updateRemoteTransportControls() {
|
||||||
|
self.player?.setupRemoteTransportControls()
|
||||||
|
}
|
||||||
|
|
||||||
// MARK: - Helper logic
|
// MARK: - Helper logic
|
||||||
|
|
||||||
private static func cleanupOldSessions(currentSessionId: String?) {
|
private static func cleanupOldSessions(currentSessionId: String?) {
|
||||||
|
|||||||
Reference in New Issue
Block a user