Skip to content

Commit

Permalink
Fixing manage videos confirmation adding videos to download queue if …
Browse files Browse the repository at this point in the history
…they ever were queued for download. Now this will be only set if download did not complete after queuing
  • Loading branch information
boggydigital committed Dec 12, 2024
1 parent b6642d4 commit 1a07acb
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion rest/view_models/video_management_view_model.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,16 @@ func GetVideoManagementModel(videoId string, rdx kevlar.ReadableRedux) *VideoMan
endedReason = data.ParseVideoEndedReason(er)
}

downloadQueued := false
if dqs, ok := rdx.GetLastVal(data.VideoDownloadQueuedProperty, videoId); ok {
downloadQueued = true
if dcs, sure := rdx.GetLastVal(data.VideoDownloadCompletedProperty, videoId); sure {
if dqs < dcs {
downloadQueued = false
}
}
}

return &VideoManagementViewModel{
VideoId: videoId,
VideoTitle: videoTitle,
Expand All @@ -43,7 +53,7 @@ func GetVideoManagementModel(videoId string, rdx kevlar.ReadableRedux) *VideoMan
Ended: rdx.HasKey(data.VideoEndedDateProperty, videoId),
EndedReason: endedReason,
AllEndedReasons: data.AllVideoEndedReasons(),
DownloadQueued: rdx.HasKey(data.VideoDownloadQueuedProperty, videoId),
DownloadQueued: downloadQueued,
ForcedDownload: rdx.HasKey(data.VideoForcedDownloadProperty, videoId),
}
}

0 comments on commit 1a07acb

Please sign in to comment.