mirror of
https://github.com/advplyr/audiobookshelf-app.git
synced 2025-07-14 16:04:47 +02:00
Sync player session with server media progress
This commit is contained in:
parent
519969eee0
commit
5fd3f3c080
3 changed files with 51 additions and 0 deletions
|
@ -205,6 +205,14 @@ class ApiClient {
|
|||
}
|
||||
}
|
||||
|
||||
public static func getMediaProgress(libraryItemId: String, episodeId: String?, callback: @escaping (_ progress: MediaProgress?) -> Void) {
|
||||
NSLog("getMediaProgress \(libraryItemId) \(episodeId ?? "NIL")")
|
||||
let endpoint = episodeId?.isEmpty ?? true ? "api/me/progress/\(libraryItemId)" : "api/me/progress/\(libraryItemId)/\(episodeId ?? "")"
|
||||
getResource(endpoint: endpoint, decodable: MediaProgress.self) { obj in
|
||||
callback(obj)
|
||||
}
|
||||
}
|
||||
|
||||
public static func getLibraryItemWithProgress(libraryItemId:String, episodeId:String?, callback: @escaping (_ param: LibraryItem?) -> Void) {
|
||||
var endpoint = "api/items/\(libraryItemId)?expanded=1&include=progress"
|
||||
if episodeId != nil {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue