mirror of
https://github.com/Suwayomi/Suwayomi-Server.git
synced 2026-06-30 17:34:39 -05:00
Lint
This commit is contained in:
@@ -125,24 +125,25 @@ object ExtensionStoreService {
|
|||||||
ExtensionStoreTable.selectAll().toList()
|
ExtensionStoreTable.selectAll().toList()
|
||||||
}
|
}
|
||||||
var needsPrefUpdate = false
|
var needsPrefUpdate = false
|
||||||
val updateStores = stores.mapNotNull { storeRow ->
|
val updateStores =
|
||||||
val oldIndexUrl = storeRow[ExtensionStoreTable.indexUrl]
|
stores.mapNotNull { storeRow ->
|
||||||
val oldName = storeRow[ExtensionStoreTable.name]
|
val oldIndexUrl = storeRow[ExtensionStoreTable.indexUrl]
|
||||||
try {
|
val oldName = storeRow[ExtensionStoreTable.name]
|
||||||
val store = fetch(oldIndexUrl)
|
try {
|
||||||
if (store.indexUrl != oldIndexUrl) {
|
val store = fetch(oldIndexUrl)
|
||||||
transaction {
|
if (store.indexUrl != oldIndexUrl) {
|
||||||
ExtensionStoreTable.deleteWhere { ExtensionStoreTable.indexUrl eq oldIndexUrl }
|
transaction {
|
||||||
|
ExtensionStoreTable.deleteWhere { ExtensionStoreTable.indexUrl eq oldIndexUrl }
|
||||||
|
}
|
||||||
|
needsPrefUpdate = true
|
||||||
}
|
}
|
||||||
needsPrefUpdate = true
|
upsert(store)
|
||||||
|
store
|
||||||
|
} catch (e: Exception) {
|
||||||
|
logger.warn(e) { "Failed to fetch extension store '$oldName ($oldIndexUrl)'" }
|
||||||
|
null
|
||||||
}
|
}
|
||||||
upsert(store)
|
|
||||||
store
|
|
||||||
} catch (e: Exception) {
|
|
||||||
logger.warn(e) { "Failed to fetch extension store '$oldName ($oldIndexUrl)'" }
|
|
||||||
null
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
if (needsPrefUpdate) syncDbToPrefs()
|
if (needsPrefUpdate) syncDbToPrefs()
|
||||||
return updateStores
|
return updateStores
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user