mirror of
https://github.com/libre-tube/LibreTube.git
synced 2024-12-14 14:20:30 +05:30
Show file type upon import failure
This commit is contained in:
parent
3036e8bf5f
commit
8315345818
@ -47,7 +47,8 @@ class ImportHelper(
|
||||
* Get a list of channel IDs from a file [Uri]
|
||||
*/
|
||||
private fun getChannelsFromUri(uri: Uri): List<String> {
|
||||
return when (activity.contentResolver.getType(uri)) {
|
||||
val fileType = activity.contentResolver.getType(uri)
|
||||
return when (fileType) {
|
||||
"application/json" -> {
|
||||
// NewPipe subscriptions format
|
||||
val mapper = ObjectMapper()
|
||||
@ -70,7 +71,7 @@ class ImportHelper(
|
||||
}
|
||||
}.orEmpty()
|
||||
}
|
||||
else -> throw IllegalArgumentException("Unsupported file type")
|
||||
else -> throw IllegalArgumentException("Unsupported file type: $fileType")
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user