mirror of
https://github.com/advplyr/audiobookshelf-app.git
synced 2026-08-29 06:37:16 +02:00
Fix sleep timer increase & decrease
This commit is contained in:
@@ -111,7 +111,7 @@ public class AbsAudioPlayer: CAPPlugin {
|
|||||||
guard let time = Int(timeString) else { return call.resolve([ "success": false ]) }
|
guard let time = Int(timeString) else { return call.resolve([ "success": false ]) }
|
||||||
guard let currentSleepTime = PlayerHandler.remainingSleepTime else { return call.resolve([ "success": false ]) }
|
guard let currentSleepTime = PlayerHandler.remainingSleepTime else { return call.resolve([ "success": false ]) }
|
||||||
|
|
||||||
PlayerHandler.remainingSleepTime = currentSleepTime - time
|
PlayerHandler.remainingSleepTime = currentSleepTime - (time / 1000)
|
||||||
call.resolve()
|
call.resolve()
|
||||||
}
|
}
|
||||||
@objc func increaseSleepTime(_ call: CAPPluginCall) {
|
@objc func increaseSleepTime(_ call: CAPPluginCall) {
|
||||||
@@ -119,7 +119,7 @@ public class AbsAudioPlayer: CAPPlugin {
|
|||||||
guard let time = Int(timeString) else { return call.resolve([ "success": false ]) }
|
guard let time = Int(timeString) else { return call.resolve([ "success": false ]) }
|
||||||
guard let currentSleepTime = PlayerHandler.remainingSleepTime else { return call.resolve([ "success": false ]) }
|
guard let currentSleepTime = PlayerHandler.remainingSleepTime else { return call.resolve([ "success": false ]) }
|
||||||
|
|
||||||
PlayerHandler.remainingSleepTime = currentSleepTime + time
|
PlayerHandler.remainingSleepTime = currentSleepTime + (time / 1000)
|
||||||
call.resolve()
|
call.resolve()
|
||||||
}
|
}
|
||||||
@objc func setSleepTimer(_ call: CAPPluginCall) {
|
@objc func setSleepTimer(_ call: CAPPluginCall) {
|
||||||
|
|||||||
Reference in New Issue
Block a user