Default to http for pre-configured syncs

When a user had configured a sync server before, it had no protocol specified.
This commit "restores" the previous behaviour of using http by default.
This commit is contained in:
Nicolai Dagestad
2024-08-18 12:19:21 +02:00
committed by Koitharu
parent 58cdc9f29a
commit 249c8377bd

View File

@@ -30,7 +30,11 @@ class SyncSettings(
@set:WorkerThread
var syncURL: String
get() = account?.let {
accountManager.getUserData(it, KEY_SYNC_URL)
val sync_url = accountManager.getUserData(it, KEY_SYNC_URL)
if ( !sync_url.startsWith("http://") && !sync_url.startsWith("https://") ) {
return "http://$sync_url"
}
return sync_url
}.ifNullOrEmpty { defaultSyncUrl }
set(value) {
account?.let {