mirror of
https://github.com/libre-tube/LibreTube.git
synced 2024-12-14 22:30:30 +05:30
Merge pull request #2400 from Bnyro/master
Make YT playlist import language independent
This commit is contained in:
commit
bebb0d465e
@ -121,8 +121,8 @@ class ImportHelper(
|
|||||||
activity.contentResolver.openInputStream(uri)?.use {
|
activity.contentResolver.openInputStream(uri)?.use {
|
||||||
val lines = it.bufferedReader().readLines()
|
val lines = it.bufferedReader().readLines()
|
||||||
playlist.name = lines[1].split(",").reversed()[2]
|
playlist.name = lines[1].split(",").reversed()[2]
|
||||||
val splitIndex = lines.indexOfFirst { line -> line.startsWith("Video ID") }
|
val splitIndex = lines.indexOfFirst { line -> line.isBlank() }
|
||||||
lines.subList(splitIndex + 1, lines.size).forEach { line ->
|
lines.subList(splitIndex + 2, lines.size).forEach { line ->
|
||||||
line.split(",").firstOrNull()?.let { videoId ->
|
line.split(",").firstOrNull()?.let { videoId ->
|
||||||
if (videoId.isNotBlank()) playlist.videos = playlist.videos + videoId
|
if (videoId.isNotBlank()) playlist.videos = playlist.videos + videoId
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user