mirror of
https://github.com/libre-tube/LibreTube.git
synced 2025-04-28 07:50:31 +05:30
Merge pull request #1889 from Bnyro/master
allow unknown file types for importing subscriptions
This commit is contained in:
commit
c804044582
@ -44,7 +44,7 @@ class ImportHelper(
|
|||||||
).show()
|
).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, e.localizedMessage, Toast.LENGTH_SHORT).show()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -53,7 +53,7 @@ class ImportHelper(
|
|||||||
*/
|
*/
|
||||||
private fun getChannelsFromUri(uri: Uri): List<String> {
|
private fun getChannelsFromUri(uri: Uri): List<String> {
|
||||||
return when (val fileType = activity.contentResolver.getType(uri)) {
|
return when (val fileType = activity.contentResolver.getType(uri)) {
|
||||||
"application/json" -> {
|
"application/json", "application/octet-stream" -> {
|
||||||
// NewPipe subscriptions format
|
// NewPipe subscriptions format
|
||||||
val mapper = ObjectMapper()
|
val mapper = ObjectMapper()
|
||||||
val json = activity.contentResolver.openInputStream(uri)?.use {
|
val json = activity.contentResolver.openInputStream(uri)?.use {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user