mirror of
https://github.com/libre-tube/LibreTube.git
synced 2025-04-29 16:30:31 +05:30
fix: crash when importing private videos in watch history
This commit is contained in:
parent
acf05bac2d
commit
152012b440
@ -269,7 +269,7 @@ object ImportHelper {
|
||||
JsonHelper.json.decodeFromStream<List<YouTubeWatchHistoryFileItem>>(it)
|
||||
}
|
||||
.orEmpty()
|
||||
.filter { it.activityControls.contains("YouTube watch history") }
|
||||
.filter { it.activityControls.contains("YouTube watch history") && it.subtitles.isNotEmpty() }
|
||||
.reversed()
|
||||
.map {
|
||||
val videoId = it.titleUrl.substring(it.titleUrl.length - 11)
|
||||
|
@ -4,11 +4,11 @@ import kotlinx.serialization.Serializable
|
||||
|
||||
@Serializable
|
||||
data class YouTubeWatchHistoryFileItem(
|
||||
val activityControls: List<String>,
|
||||
val header: String,
|
||||
val products: List<String>,
|
||||
val subtitles: List<YouTubeWatchHistoryChannelInfo>,
|
||||
val time: String,
|
||||
val title: String,
|
||||
val titleUrl: String
|
||||
val titleUrl: String,
|
||||
val activityControls: List<String> = emptyList(),
|
||||
val products: List<String> = emptyList(),
|
||||
val subtitles: List<YouTubeWatchHistoryChannelInfo> = emptyList()
|
||||
)
|
Loading…
x
Reference in New Issue
Block a user