mirror of
https://gitlab.futo.org/videostreaming/grayjay.git
synced 2025-08-02 22:30:40 +00:00
updated URL and catch HTTP errors
This commit is contained in:
parent
77a558dbe5
commit
bf1a6b7d0a
1 changed files with 9 additions and 5 deletions
|
@ -558,15 +558,19 @@ class MainActivity : AppCompatActivity, IWithResultLauncher {
|
||||||
UIDialogs.Action("Cancel", { }, UIDialogs.ActionStyle.NONE),
|
UIDialogs.Action("Cancel", { }, UIDialogs.ActionStyle.NONE),
|
||||||
UIDialogs.Action("Upload", {
|
UIDialogs.Action("Upload", {
|
||||||
GlobalScope.launch(Dispatchers.IO) {
|
GlobalScope.launch(Dispatchers.IO) {
|
||||||
val url = "https://logs.grayjay.app/subscriptions"
|
val url = "https://data.grayjay.app/donate-subscription-list"
|
||||||
val client = ManagedHttpClient();
|
val client = ManagedHttpClient();
|
||||||
val headers = hashMapOf(
|
val headers = hashMapOf(
|
||||||
"Content-Type" to "application/json"
|
"Content-Type" to "application/json"
|
||||||
)
|
)
|
||||||
val response = client.post(url, json, headers)
|
try {
|
||||||
// if it failed retry one time
|
val response = client.post(url, json, headers)
|
||||||
if (!response.isOk) {
|
// if it failed retry one time
|
||||||
client.post(url, json, headers)
|
if (!response.isOk) {
|
||||||
|
client.post(url, json, headers)
|
||||||
|
}
|
||||||
|
} catch (e: Exception) {
|
||||||
|
Logger.i(TAG, "Failed to submit subscription list.", e)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}, UIDialogs.ActionStyle.PRIMARY)
|
}, UIDialogs.ActionStyle.PRIMARY)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue