Merge pull request #1889 from Bnyro/master

allow unknown file types for importing subscriptions
This commit is contained in:
Bnyro 2022-11-17 19:05:12 +01:00 committed by GitHub
commit c804044582
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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 {