Add function getServerById to shared module and format code

This commit is contained in:
2020-11-30 12:00:36 +01:00
parent 56c98db0b8
commit 48ee2c3c89
6 changed files with 9 additions and 5 deletions

View File

@@ -4,4 +4,4 @@ import com.squareup.sqldelight.db.SqlDriver
object DatabaseFactory {
fun createDatabase(sqlDriver: SqlDriver) = AppDatabase(sqlDriver)
}
}

View File

@@ -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)
}

View File

@@ -24,4 +24,4 @@ class CFlow<T>(private val origin: Flow<T>) : Flow<T> by origin {
}
}
}
}
}

View File

@@ -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 {