Fix casting mixes, add "Open in YouTube" button
This commit is contained in:
1 parent
1047a7882a
commit
6ac29a5bbb
11 files changed
+77
-12
No files matched your search
@@ -7,12 +7,17 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||||||
|
|
||||||
## [Unreleased]
|
## [Unreleased]
|
||||||
|
|
||||||
|
### Added
|
||||||
|
|
||||||
|
- "Open In YouTube" button in web app cast dialog
|
||||||
|
|
||||||
### Fixed
|
### Fixed
|
||||||
|
|
||||||
- Bug in dash storyboard
|
- Bug in dash storyboard
|
||||||
- Adjust live video detection to reduce error rate happening on iOS client
|
- Adjust live video detection to reduce error rate happening on iOS client
|
||||||
- Bug when parsing headers in telemetry
|
- Bug when parsing headers in telemetry
|
||||||
- Web app fixes and dependency updates
|
- Web app fixes and dependency updates
|
||||||
|
- Bug when casting a mix from web app
|
||||||
|
|
||||||
## [0.41.8] - 2025-09-07
|
## [0.41.8] - 2025-09-07
|
||||||
|
|
||||||
|
|||||||
@@ -7,14 +7,14 @@ import "pkg:/source/utils/TimeUtils.bs"
|
|||||||
namespace InvidiousContent
|
namespace InvidiousContent
|
||||||
|
|
||||||
function ToRowCellContentNode(item as object, instance as dynamic) as object
|
function ToRowCellContentNode(item as object, instance as dynamic) as object
|
||||||
if item.videoId <> invalid and (item.type = invalid or item.type = "shortVideo")
|
|
||||||
item.type = "video"
|
|
||||||
end if
|
|
||||||
|
|
||||||
if item.playlistId <> invalid and (item.type = invalid or item.type = "invidiousPlaylist")
|
if item.playlistId <> invalid and (item.type = invalid or item.type = "invidiousPlaylist")
|
||||||
item.type = "playlist"
|
item.type = "playlist"
|
||||||
end if
|
end if
|
||||||
|
|
||||||
|
if item.videoId <> invalid and (item.type = invalid or item.type = "shortVideo")
|
||||||
|
item.type = "video"
|
||||||
|
end if
|
||||||
|
|
||||||
if item.type <> "video" and item.type <> "playlist" and item.type <> "channel"
|
if item.type <> "video" and item.type <> "playlist" and item.type <> "channel"
|
||||||
return invalid
|
return invalid
|
||||||
end if
|
end if
|
||||||
|
|||||||
@@ -21,10 +21,16 @@ namespace Http
|
|||||||
response = context.response
|
response = context.response
|
||||||
|
|
||||||
playlistId = request.query.playlistId
|
playlistId = request.query.playlistId
|
||||||
|
' Mix continuation (playlistId starts with "RD")
|
||||||
|
videoId = request.query.videoId
|
||||||
authorId = request.query.authorId
|
authorId = request.query.authorId
|
||||||
|
|
||||||
if not StringUtils.IsNullOrEmpty(playlistId)
|
if not StringUtils.IsNullOrEmpty(playlistId)
|
||||||
contentNode = InvidiousContent.ToPlaylistContentNode(invalid, { playlistId: playlistId }, invalid)
|
content = { playlistId: playlistId }
|
||||||
|
if playlistId.startsWith("RD") and not StringUtils.IsNullOrEmpty(videoId)
|
||||||
|
content.videoId = videoId
|
||||||
|
end if
|
||||||
|
contentNode = InvidiousContent.ToPlaylistContentNode(invalid, content, invalid)
|
||||||
PlaylistUtils.Open(contentNode, m.appController)
|
PlaylistUtils.Open(contentNode, m.appController)
|
||||||
if VideoQueueUtils.IsVideoPlayerOpen(m.videoQueue) and VideoQueueUtils.IsVideoPlayerFullScreen(m.videoQueue)
|
if VideoQueueUtils.IsVideoPlayerOpen(m.videoQueue) and VideoQueueUtils.IsVideoPlayerFullScreen(m.videoQueue)
|
||||||
VideoQueueUtils.ToggleVideoPictureInPicture(m.videoQueue)
|
VideoQueueUtils.ToggleVideoPictureInPicture(m.videoQueue)
|
||||||
|
|||||||
@@ -1184,6 +1184,10 @@
|
|||||||
<source>Open in Invidious</source>
|
<source>Open in Invidious</source>
|
||||||
<translation>Open in Invidious</translation>
|
<translation>Open in Invidious</translation>
|
||||||
</message>
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>Open in YouTube</source>
|
||||||
|
<translation>Open in YouTube</translation>
|
||||||
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<source>Start at</source>
|
<source>Start at</source>
|
||||||
<translation>Start at</translation>
|
<translation>Start at</translation>
|
||||||
|
|||||||
@@ -399,6 +399,7 @@ namespace Locale
|
|||||||
QueueOn = "Queue on %1"
|
QueueOn = "Queue on %1"
|
||||||
OpenOn = "Open on %1"
|
OpenOn = "Open on %1"
|
||||||
OpenInInvidious = "Open in Invidious"
|
OpenInInvidious = "Open in Invidious"
|
||||||
|
OpenInYouTube = "Open in YouTube"
|
||||||
StartAt = "Start at"
|
StartAt = "Start at"
|
||||||
end enum
|
end enum
|
||||||
|
|
||||||
|
|||||||
@@ -128,11 +128,15 @@ export class PlayletApi {
|
|||||||
await PlayletApi.postJson(`${PlayletApi.host()}/api/queue`, args);
|
await PlayletApi.postJson(`${PlayletApi.host()}/api/queue`, args);
|
||||||
}
|
}
|
||||||
|
|
||||||
static async openPlaylist(playlistId) {
|
static async openPlaylist(playlistId, continuationVideoId) {
|
||||||
if (!playlistId) {
|
if (!playlistId) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
await fetch(`${PlayletApi.host()}/api/view/open?playlistId=${playlistId}`);
|
let url = `${PlayletApi.host()}/api/view/open?playlistId=${playlistId}`;
|
||||||
|
if (continuationVideoId) {
|
||||||
|
url += `&videoId=${continuationVideoId}`;
|
||||||
|
}
|
||||||
|
await fetch(url);
|
||||||
}
|
}
|
||||||
|
|
||||||
static async openChannel(authorId) {
|
static async openChannel(authorId) {
|
||||||
|
|||||||
@@ -36,6 +36,11 @@
|
|||||||
let url = `${invidiousInstanceForRedirect}/channel/${authorId}`;
|
let url = `${invidiousInstanceForRedirect}/channel/${authorId}`;
|
||||||
window.open(url);
|
window.open(url);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function openYouTube() {
|
||||||
|
let url = `https://www.youtube.com/channel/${authorId}`;
|
||||||
|
window.open(url);
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<dialog bind:this={modal} class="modal">
|
<dialog bind:this={modal} class="modal">
|
||||||
@@ -56,6 +61,9 @@
|
|||||||
<button class="btn join-item hover:btn-accent" on:click={openInvidious}>
|
<button class="btn join-item hover:btn-accent" on:click={openInvidious}>
|
||||||
{$translate("Open in Invidious")}
|
{$translate("Open in Invidious")}
|
||||||
</button>
|
</button>
|
||||||
|
<button class="btn join-item hover:btn-accent" on:click={openYouTube}>
|
||||||
|
{$translate("Open in YouTube")}
|
||||||
|
</button>
|
||||||
<button class="btn join-item hover:btn-accent"
|
<button class="btn join-item hover:btn-accent"
|
||||||
>{$translate("Cancel")}</button
|
>{$translate("Cancel")}</button
|
||||||
>
|
>
|
||||||
|
|||||||
@@ -9,6 +9,8 @@
|
|||||||
export let videoCountText: string | undefined = undefined;
|
export let videoCountText: string | undefined = undefined;
|
||||||
export let playlistThumbnail: string | undefined = undefined;
|
export let playlistThumbnail: string | undefined = undefined;
|
||||||
export let videos: any[] | undefined = undefined;
|
export let videos: any[] | undefined = undefined;
|
||||||
|
// videoId is Mix continuation (playlistId starts with "RD")
|
||||||
|
export let videoId: string | undefined = undefined;
|
||||||
|
|
||||||
export function show() {
|
export function show() {
|
||||||
modal.showModal();
|
modal.showModal();
|
||||||
@@ -42,11 +44,28 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
async function openOnTv() {
|
async function openOnTv() {
|
||||||
await PlayletApi.openPlaylist(playlistId);
|
const continuationVideoId =
|
||||||
|
playlistId.startsWith("RD") && videoId ? videoId : undefined;
|
||||||
|
await PlayletApi.openPlaylist(playlistId, continuationVideoId);
|
||||||
}
|
}
|
||||||
|
|
||||||
function openInvidious() {
|
function openInvidious() {
|
||||||
let url = `${invidiousInstanceForRedirect}/playlist?list=${playlistId}`;
|
const continuationVideoId =
|
||||||
|
playlistId.startsWith("RD") && videoId ? videoId : undefined;
|
||||||
|
let url = `${invidiousInstanceForRedirect}/mix?list=${playlistId}`;
|
||||||
|
if (continuationVideoId) {
|
||||||
|
url += `&continuation=${continuationVideoId}`;
|
||||||
|
}
|
||||||
|
window.open(url);
|
||||||
|
}
|
||||||
|
|
||||||
|
function openYouTube() {
|
||||||
|
let url = "https://www.youtube.com";
|
||||||
|
if (videoId && playlistId.startsWith("RD")) {
|
||||||
|
url += `/watch?v=${videoId}&list=${playlistId}`;
|
||||||
|
} else {
|
||||||
|
url += `/playlist?list=${playlistId}`;
|
||||||
|
}
|
||||||
window.open(url);
|
window.open(url);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -59,6 +78,7 @@
|
|||||||
videoCount,
|
videoCount,
|
||||||
videoCountText,
|
videoCountText,
|
||||||
videos,
|
videos,
|
||||||
|
videoId,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -119,6 +139,9 @@
|
|||||||
<button class="btn join-item hover:btn-accent" on:click={openInvidious}>
|
<button class="btn join-item hover:btn-accent" on:click={openInvidious}>
|
||||||
{$translate("Open in Invidious")}
|
{$translate("Open in Invidious")}
|
||||||
</button>
|
</button>
|
||||||
|
<button class="btn join-item hover:btn-accent" on:click={openYouTube}>
|
||||||
|
{$translate("Open in YouTube")}
|
||||||
|
</button>
|
||||||
<button class="btn join-item hover:btn-accent"
|
<button class="btn join-item hover:btn-accent"
|
||||||
>{$translate("Cancel")}</button
|
>{$translate("Cancel")}</button
|
||||||
>
|
>
|
||||||
|
|||||||
@@ -12,6 +12,8 @@
|
|||||||
export let videoCountText: string | undefined = undefined;
|
export let videoCountText: string | undefined = undefined;
|
||||||
export let videos: any[] | undefined = undefined;
|
export let videos: any[] | undefined = undefined;
|
||||||
export let updated: number | undefined = undefined;
|
export let updated: number | undefined = undefined;
|
||||||
|
// videoId is Mix continuation (playlistId starts with "RD")
|
||||||
|
export let videoId: string | undefined = undefined;
|
||||||
export let lines: string[] | undefined = undefined;
|
export let lines: string[] | undefined = undefined;
|
||||||
|
|
||||||
// svelte-ignore unused-export-let
|
// svelte-ignore unused-export-let
|
||||||
@@ -112,4 +114,5 @@
|
|||||||
bind:videoCount
|
bind:videoCount
|
||||||
bind:videoCountText
|
bind:videoCountText
|
||||||
bind:videos
|
bind:videos
|
||||||
|
bind:videoId
|
||||||
/>
|
/>
|
||||||
@@ -81,6 +81,14 @@
|
|||||||
window.open(url);
|
window.open(url);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function openYouTube() {
|
||||||
|
let url = `https://www.youtube.com/watch?v=${videoId}`;
|
||||||
|
if (videoStartAtChecked && videoStartAtTimestamp) {
|
||||||
|
url += `&t=${videoStartAtTimestamp}`;
|
||||||
|
}
|
||||||
|
window.open(url);
|
||||||
|
}
|
||||||
|
|
||||||
function getVideoInfo() {
|
function getVideoInfo() {
|
||||||
const timestamp = videoStartAtChecked ? videoStartAtTimestamp : undefined;
|
const timestamp = videoStartAtChecked ? videoStartAtTimestamp : undefined;
|
||||||
return {
|
return {
|
||||||
@@ -154,6 +162,9 @@
|
|||||||
<button class="btn join-item hover:btn-accent" on:click={openInvidious}>
|
<button class="btn join-item hover:btn-accent" on:click={openInvidious}>
|
||||||
{$translate("Open in Invidious")}
|
{$translate("Open in Invidious")}
|
||||||
</button>
|
</button>
|
||||||
|
<button class="btn join-item hover:btn-accent" on:click={openYouTube}>
|
||||||
|
{$translate("Open in YouTube")}
|
||||||
|
</button>
|
||||||
<button class="btn join-item hover:btn-accent"
|
<button class="btn join-item hover:btn-accent"
|
||||||
>{$translate("Cancel")}</button
|
>{$translate("Cancel")}</button
|
||||||
>
|
>
|
||||||
|
|||||||
@@ -204,10 +204,10 @@
|
|||||||
const newVideos = items;
|
const newVideos = items;
|
||||||
|
|
||||||
newVideos.forEach((item) => {
|
newVideos.forEach((item) => {
|
||||||
if (item.videoId) {
|
if (item.playlistId) {
|
||||||
item.type = "video";
|
|
||||||
} else if (item.playlistId) {
|
|
||||||
item.type = "playlist";
|
item.type = "playlist";
|
||||||
|
} else if (item.videoId) {
|
||||||
|
item.type = "video";
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user