mirror of
https://github.com/libre-tube/LibreTube.git
synced 2024-12-15 06:40:30 +05:30
Merge pull request #1876 from Bnyro/master
[fix] actually show the determined file type
This commit is contained in:
commit
0039f502b6
@ -36,7 +36,12 @@ class ImportHelper(
|
|||||||
}
|
}
|
||||||
} catch (e: IllegalArgumentException) {
|
} catch (e: IllegalArgumentException) {
|
||||||
Log.e(TAG(), e.toString())
|
Log.e(TAG(), e.toString())
|
||||||
Toast.makeText(activity, R.string.unsupported_file_format, Toast.LENGTH_SHORT).show()
|
Toast.makeText(
|
||||||
|
activity,
|
||||||
|
activity.getString(R.string.unsupported_file_format) +
|
||||||
|
" (${activity.contentResolver.getType(uri)}",
|
||||||
|
Toast.LENGTH_SHORT
|
||||||
|
).show()
|
||||||
} catch (e: Exception) {
|
} catch (e: Exception) {
|
||||||
Log.e(TAG(), e.toString())
|
Log.e(TAG(), e.toString())
|
||||||
Toast.makeText(activity, R.string.server_error, Toast.LENGTH_SHORT).show()
|
Toast.makeText(activity, R.string.server_error, Toast.LENGTH_SHORT).show()
|
||||||
@ -47,8 +52,7 @@ 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> {
|
||||||
val fileType = activity.contentResolver.getType(uri)
|
return when (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()
|
||||||
|
Loading…
Reference in New Issue
Block a user