mirror of
https://github.com/KokaKiwi/BarInsta
synced 2024-11-14 10:47:30 +00:00
fix download extension parsing
This commit is contained in:
parent
506e0c5685
commit
06f679608c
@ -209,9 +209,7 @@ object DownloadUtils {
|
|||||||
val extension = getFileExtensionFromUrl(displayUrl)
|
val extension = getFileExtensionFromUrl(displayUrl)
|
||||||
val usernamePrepend = if (isEmpty(username)) "" else username + "_"
|
val usernamePrepend = if (isEmpty(username)) "" else username + "_"
|
||||||
val fileName = usernamePrepend + postId + sliderPostfix + extension
|
val fileName = usernamePrepend + postId + sliderPostfix + extension
|
||||||
val mimeType = Utils.mimeTypeMap.getMimeTypeFromExtension(
|
val mimeType = Utils.mimeTypeMap.getMimeTypeFromExtension(extension)
|
||||||
if (extension.startsWith(".")) extension.substring(1) else extension
|
|
||||||
)
|
|
||||||
return Pair(fileName, mimeType!!)
|
return Pair(fileName, mimeType!!)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -269,7 +267,7 @@ object DownloadUtils {
|
|||||||
) {
|
) {
|
||||||
val dotPos = filename.lastIndexOf('.')
|
val dotPos = filename.lastIndexOf('.')
|
||||||
if (0 <= dotPos) {
|
if (0 <= dotPos) {
|
||||||
return filename.substring(dotPos)
|
return filename.substring(dotPos + 1)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user