update: increase update intervals

This commit is contained in:
benonymity 2023-01-24 17:34:53 -05:00
parent a8c66ff808
commit 20085c5eed
3 changed files with 37 additions and 11 deletions

View file

@ -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]?