mirror of
https://github.com/advplyr/audiobookshelf-app.git
synced 2025-08-04 10:04:39 +02:00
update: increase update intervals
This commit is contained in:
parent
a8c66ff808
commit
20085c5eed
3 changed files with 37 additions and 11 deletions
|
@ -243,12 +243,28 @@ class ApiClient {
|
|||
callback(obj)
|
||||
}
|
||||
}
|
||||
public static func pingServer() async -> Bool {
|
||||
var status = true
|
||||
AF.request("\(Store.serverConfig!.address)/ping", method: .get).responseDecodable(of: PingResponsePayload.self) { response in
|
||||
switch response.result {
|
||||
case .success:
|
||||
status = true
|
||||
case .failure:
|
||||
status = false
|
||||
}
|
||||
}
|
||||
return status
|
||||
}
|
||||
}
|
||||
|
||||
struct LocalMediaProgressSyncPayload: Codable {
|
||||
var localMediaProgress: [LocalMediaProgress]
|
||||
}
|
||||
|
||||
struct PingResponsePayload: Codable {
|
||||
var success: Bool
|
||||
}
|
||||
|
||||
struct MediaProgressSyncResponsePayload: Decodable {
|
||||
var numServerProgressUpdates: Int?
|
||||
var localProgressUpdates: [LocalMediaProgress]?
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue