Fix trailing slash in baseUrl not loading images (#114)

This commit is contained in:
Jarne Demeulemeester 2022-04-29 23:49:41 +02:00 committed by GitHub
parent 84bb1ac073
commit c6385caf0f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 2 deletions

View file

@ -106,7 +106,7 @@ fun bindSeasonPoster(imageView: ImageView, seasonId: UUID) {
private fun ImageView.loadImage(url: String, @DrawableRes errorPlaceHolderId: Int? = null): View {
val api = JellyfinApi.getInstance(context.applicationContext)
return Glide
Glide
.with(context)
.load("${api.api.baseUrl}$url")
.transition(DrawableTransitionOptions.withCrossFade())
@ -114,6 +114,8 @@ private fun ImageView.loadImage(url: String, @DrawableRes errorPlaceHolderId: In
.error(errorPlaceHolderId)
.into(this)
.view
return this
}
private fun View.posterDescription(name: String?) {

View file

@ -82,7 +82,7 @@ class AddServerFragment : Fragment() {
private fun connectToServer() {
val serverAddress = binding.editTextServerAddress.text.toString()
viewModel.checkServer(serverAddress)
viewModel.checkServer(serverAddress.removeSuffix("/"))
}
private fun navigateToLoginFragment() {