From f58137b326050f9e89559063d59648e631f26219 Mon Sep 17 00:00:00 2001 From: Brahim Hadriche Date: Fri, 27 Oct 2023 20:01:18 -0400 Subject: [PATCH] Fix casting timestamp --- CHANGELOG.md | 4 ++++ playlet-web/src/lib/LinkDragDrop.svelte | 6 ++++-- playlet-web/src/lib/Screens/Home/VideoCell.svelte | 6 ++++-- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index eb31859d..05f32a57 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Pagination support in web app search (load more button) - Video links pasted into the web app triggers the dialog to cast the video +### Fixed + +- A bug where casting from web included timestamp even if the "Start at" check box is unchecked + ## [0.14.0] - 2023-10-25 ### Added diff --git a/playlet-web/src/lib/LinkDragDrop.svelte b/playlet-web/src/lib/LinkDragDrop.svelte index eb80d7d4..a493833e 100644 --- a/playlet-web/src/lib/LinkDragDrop.svelte +++ b/playlet-web/src/lib/LinkDragDrop.svelte @@ -187,17 +187,19 @@ } async function playVideoOnTv() { + const timestamp = videoStartAtChecked ? videoStartAtTimestamp : undefined; await PlayletApi.playVideo( videoMetadata?.videoId, - videoStartAtTimestamp, + timestamp, videoMetadata?.title, videoMetadata?.author ); } async function queueVideoOnTv() { + const timestamp = videoStartAtChecked ? videoStartAtTimestamp : undefined; await PlayletApi.queueVideo( videoMetadata?.videoId, - videoStartAtTimestamp, + timestamp, videoMetadata?.title, videoMetadata?.author ); diff --git a/playlet-web/src/lib/Screens/Home/VideoCell.svelte b/playlet-web/src/lib/Screens/Home/VideoCell.svelte index 0143d6e9..c38e3d7d 100644 --- a/playlet-web/src/lib/Screens/Home/VideoCell.svelte +++ b/playlet-web/src/lib/Screens/Home/VideoCell.svelte @@ -180,11 +180,13 @@ } async function playVideoOnTv() { - await PlayletApi.playVideo(videoId, videoStartAtTimestamp, title, author); + const timestamp = videoStartAtChecked ? videoStartAtTimestamp : undefined; + await PlayletApi.playVideo(videoId, timestamp, title, author); } async function queueVideoOnTv() { - await PlayletApi.queueVideo(videoId, videoStartAtTimestamp, title, author); + const timestamp = videoStartAtChecked ? videoStartAtTimestamp : undefined; + await PlayletApi.queueVideo(videoId, timestamp, title, author); } function openInvidiousInNewTab() {