mirror of
https://github.com/advplyr/audiobookshelf-app.git
synced 2026-08-28 06:14:00 +02:00
update: increase update intervals
This commit is contained in:
@@ -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]?
|
||||
|
||||
Reference in New Issue
Block a user