File tree Expand file tree Collapse file tree
app/src/main/java/org/schabi/newpipe/database/history/model Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -3,6 +3,8 @@ package org.schabi.newpipe.database.history.model
33import androidx.room.ColumnInfo
44import androidx.room.Embedded
55import org.schabi.newpipe.database.stream.model.StreamEntity
6+ import org.schabi.newpipe.extractor.stream.StreamInfoItem
7+ import org.schabi.newpipe.util.image.ImageStrategy
68import java.time.OffsetDateTime
79
810data class StreamHistoryEntry (
@@ -27,4 +29,17 @@ data class StreamHistoryEntry(
2729 return this .streamEntity.uid == other.streamEntity.uid && streamId == other.streamId &&
2830 accessDate.isEqual(other.accessDate)
2931 }
32+
33+ fun toStreamInfoItem (): StreamInfoItem =
34+ StreamInfoItem (
35+ streamEntity.serviceId,
36+ streamEntity.url,
37+ streamEntity.title,
38+ streamEntity.streamType,
39+ ).apply {
40+ duration = streamEntity.duration
41+ uploaderName = streamEntity.uploader
42+ uploaderUrl = streamEntity.uploaderUrl
43+ thumbnails = ImageStrategy .dbUrlToImageList(streamEntity.thumbnailUrl)
44+ }
3045}
You can’t perform that action at this time.
0 commit comments