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