mirror of
https://github.com/libre-tube/LibreTube.git
synced 2025-04-28 16:00:31 +05:30
Merge pull request #1875 from Bnyro/master
Show file type upon import failure
This commit is contained in:
commit
0b50606609
@ -47,7 +47,8 @@ class ImportHelper(
|
|||||||
* Get a list of channel IDs from a file [Uri]
|
* Get a list of channel IDs from a file [Uri]
|
||||||
*/
|
*/
|
||||||
private fun getChannelsFromUri(uri: Uri): List<String> {
|
private fun getChannelsFromUri(uri: Uri): List<String> {
|
||||||
return when (activity.contentResolver.getType(uri)) {
|
val fileType = activity.contentResolver.getType(uri)
|
||||||
|
return when (fileType) {
|
||||||
"application/json" -> {
|
"application/json" -> {
|
||||||
// NewPipe subscriptions format
|
// NewPipe subscriptions format
|
||||||
val mapper = ObjectMapper()
|
val mapper = ObjectMapper()
|
||||||
@ -70,7 +71,7 @@ class ImportHelper(
|
|||||||
}
|
}
|
||||||
}.orEmpty()
|
}.orEmpty()
|
||||||
}
|
}
|
||||||
else -> throw IllegalArgumentException("Unsupported file type")
|
else -> throw IllegalArgumentException("Unsupported file type: $fileType")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user