Remove v1 version from v0 data source
This commit is contained in:
@@ -46,25 +46,14 @@ class MealieDataSourceImpl @Inject constructor(
|
||||
logParameters = { "baseUrl = $baseUrl" },
|
||||
).getOrElse {
|
||||
when (it) {
|
||||
is HttpException, is SerializationException -> getVersionInfoV1(baseUrl)
|
||||
is SocketTimeoutException,
|
||||
is ConnectException -> throw NetworkError.NoServerConnection(it)
|
||||
is HttpException, is SerializationException -> throw NetworkError.NotMealie(it)
|
||||
is SocketTimeoutException, is ConnectException -> throw NetworkError.NoServerConnection(
|
||||
it
|
||||
)
|
||||
else -> throw NetworkError.MalformedUrl(it)
|
||||
}
|
||||
}
|
||||
|
||||
private suspend fun getVersionInfoV1(baseUrl: String): VersionResponse = makeCall(
|
||||
block = { getVersion("$baseUrl/api/app/about") },
|
||||
logMethod = { "getVersionInfoV1" },
|
||||
logParameters = { "baseUrl = $baseUrl" },
|
||||
).getOrElse {
|
||||
throw when (it) {
|
||||
is HttpException, is SerializationException -> NetworkError.NotMealie(it)
|
||||
is SocketTimeoutException, is ConnectException -> NetworkError.NoServerConnection(it)
|
||||
else -> NetworkError.MalformedUrl(it)
|
||||
}
|
||||
}
|
||||
|
||||
override suspend fun requestRecipes(
|
||||
baseUrl: String, token: String?, start: Int, limit: Int
|
||||
): List<GetRecipeSummaryResponse> = makeCall(
|
||||
|
||||
Reference in New Issue
Block a user