mirror of
https://github.com/Matte23/circolapp.git
synced 2025-12-06 07:29:10 +00:00
Add function getServerById to shared module and format code
This commit is contained in:
@@ -4,4 +4,4 @@ import com.squareup.sqldelight.db.SqlDriver
|
||||
|
||||
object DatabaseFactory {
|
||||
fun createDatabase(sqlDriver: SqlDriver) = AppDatabase(sqlDriver)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -54,6 +54,10 @@ class ServerAPI(
|
||||
SUCCESS, ERROR
|
||||
}
|
||||
|
||||
fun getServer(serverID: Int): Servers {
|
||||
return Servers.values()[serverID]
|
||||
}
|
||||
|
||||
fun getServerId(server: Servers): Int {
|
||||
return Servers.values().indexOf(server)
|
||||
}
|
||||
|
||||
@@ -24,4 +24,4 @@ class CFlow<T>(private val origin: Flow<T>) : Flow<T> by origin {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@ actual class SpecificCurieServer actual constructor(private val curieServer: Cur
|
||||
val list = ArrayList<Circular>()
|
||||
|
||||
htmlList?.forEach { element ->
|
||||
if (element.parentElement?.parentElement?.parentElement?.tagName == "li") {
|
||||
if (element.parentElement?.parentElement?.parentElement?.tagName == "li") {
|
||||
list.last().attachmentsNames.add(element.textContent)
|
||||
list.last().attachmentsUrls.add(element.attributes.objectForKey("href").toString())
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user