mirror of
https://github.com/yattee/yattee.git
synced 2026-06-08 07:44:21 +00:00
Show watch progress bar on thumbnails in playlist, channel, and search views
These views rendered video thumbnails without passing watchProgress, so the progress bar was silently missing. Apply the existing pattern from SubscriptionsView: maintain a watchEntriesMap and forward watchProgress(for:) to VideoRowView/VideoCardView at each call site.
This commit is contained in:
@@ -13,12 +13,14 @@ import SwiftUI
|
||||
struct PlaylistVideoRowView: View {
|
||||
let index: Int
|
||||
let video: Video
|
||||
var watchProgress: Double? = nil
|
||||
var onRemove: (() -> Void)? = nil
|
||||
|
||||
var body: some View {
|
||||
VideoRowView(
|
||||
video: video,
|
||||
style: .regular,
|
||||
watchProgress: watchProgress,
|
||||
index: index
|
||||
)
|
||||
.videoContextMenu(
|
||||
@@ -40,9 +42,10 @@ struct PlaylistVideoRowView: View {
|
||||
|
||||
extension PlaylistVideoRowView {
|
||||
/// Initialize from a LocalPlaylistItem model.
|
||||
init(item: LocalPlaylistItem, index: Int, onRemove: @escaping () -> Void) {
|
||||
init(item: LocalPlaylistItem, index: Int, watchProgress: Double? = nil, onRemove: @escaping () -> Void) {
|
||||
self.index = index
|
||||
self.video = item.toVideo()
|
||||
self.watchProgress = watchProgress
|
||||
self.onRemove = onRemove
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user