Fix trailing slash in baseUrl not loading images (#114)
This commit is contained in:
parent
84bb1ac073
commit
c6385caf0f
2 changed files with 4 additions and 2 deletions
|
@ -106,7 +106,7 @@ fun bindSeasonPoster(imageView: ImageView, seasonId: UUID) {
|
||||||
private fun ImageView.loadImage(url: String, @DrawableRes errorPlaceHolderId: Int? = null): View {
|
private fun ImageView.loadImage(url: String, @DrawableRes errorPlaceHolderId: Int? = null): View {
|
||||||
val api = JellyfinApi.getInstance(context.applicationContext)
|
val api = JellyfinApi.getInstance(context.applicationContext)
|
||||||
|
|
||||||
return Glide
|
Glide
|
||||||
.with(context)
|
.with(context)
|
||||||
.load("${api.api.baseUrl}$url")
|
.load("${api.api.baseUrl}$url")
|
||||||
.transition(DrawableTransitionOptions.withCrossFade())
|
.transition(DrawableTransitionOptions.withCrossFade())
|
||||||
|
@ -114,6 +114,8 @@ private fun ImageView.loadImage(url: String, @DrawableRes errorPlaceHolderId: In
|
||||||
.error(errorPlaceHolderId)
|
.error(errorPlaceHolderId)
|
||||||
.into(this)
|
.into(this)
|
||||||
.view
|
.view
|
||||||
|
|
||||||
|
return this
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun View.posterDescription(name: String?) {
|
private fun View.posterDescription(name: String?) {
|
||||||
|
|
|
@ -82,7 +82,7 @@ class AddServerFragment : Fragment() {
|
||||||
|
|
||||||
private fun connectToServer() {
|
private fun connectToServer() {
|
||||||
val serverAddress = binding.editTextServerAddress.text.toString()
|
val serverAddress = binding.editTextServerAddress.text.toString()
|
||||||
viewModel.checkServer(serverAddress)
|
viewModel.checkServer(serverAddress.removeSuffix("/"))
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun navigateToLoginFragment() {
|
private fun navigateToLoginFragment() {
|
||||||
|
|
Loading…
Reference in a new issue