mirror of
https://github.com/libre-tube/LibreTube.git
synced 2025-04-29 16:30:31 +05:30
Merge pull request #6571 from Bnyro/master
fix: crash when importing private videos in watch history
This commit is contained in:
commit
54ca323bbe
@ -269,7 +269,7 @@ object ImportHelper {
|
|||||||
JsonHelper.json.decodeFromStream<List<YouTubeWatchHistoryFileItem>>(it)
|
JsonHelper.json.decodeFromStream<List<YouTubeWatchHistoryFileItem>>(it)
|
||||||
}
|
}
|
||||||
.orEmpty()
|
.orEmpty()
|
||||||
.filter { it.activityControls.contains("YouTube watch history") }
|
.filter { it.activityControls.contains("YouTube watch history") && it.subtitles.isNotEmpty() }
|
||||||
.reversed()
|
.reversed()
|
||||||
.map {
|
.map {
|
||||||
val videoId = it.titleUrl.substring(it.titleUrl.length - 11)
|
val videoId = it.titleUrl.substring(it.titleUrl.length - 11)
|
||||||
|
@ -4,11 +4,11 @@ import kotlinx.serialization.Serializable
|
|||||||
|
|
||||||
@Serializable
|
@Serializable
|
||||||
data class YouTubeWatchHistoryFileItem(
|
data class YouTubeWatchHistoryFileItem(
|
||||||
val activityControls: List<String>,
|
|
||||||
val header: String,
|
val header: String,
|
||||||
val products: List<String>,
|
|
||||||
val subtitles: List<YouTubeWatchHistoryChannelInfo>,
|
|
||||||
val time: String,
|
val time: String,
|
||||||
val title: 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