mirror of
https://github.com/libre-tube/LibreTube.git
synced 2024-12-13 22:00:30 +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()
|
||||
} catch (e: Exception) {
|
||||
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> {
|
||||
return when (val fileType = activity.contentResolver.getType(uri)) {
|
||||
"application/json" -> {
|
||||
"application/json", "application/octet-stream" -> {
|
||||
// NewPipe subscriptions format
|
||||
val mapper = ObjectMapper()
|
||||
val json = activity.contentResolver.openInputStream(uri)?.use {
|
||||
|
Loading…
Reference in New Issue
Block a user