1 parent
8975861615
commit
549913ef7d
14 files changed
+129
-20
No files matched your search
@@ -114,6 +114,20 @@ export class PlayletApi {
|
||||
return await response.json();
|
||||
}
|
||||
|
||||
static async openPlaylist(playlistId) {
|
||||
if (!playlistId) {
|
||||
return;
|
||||
}
|
||||
await fetch(`${PlayletApi.host()}/api/view/open?playlistId=${playlistId}`);
|
||||
}
|
||||
|
||||
static async openChannel(authorId) {
|
||||
if (!authorId) {
|
||||
return;
|
||||
}
|
||||
await fetch(`${PlayletApi.host()}/api/view/open?authorId=${authorId}`);
|
||||
}
|
||||
|
||||
static async getSearchHistory() {
|
||||
const response = await fetch(`${PlayletApi.host()}/api/search-history`);
|
||||
return await response.json();
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
<script lang="ts">
|
||||
import { PlayletApi } from "lib/Api/PlayletApi";
|
||||
import { playletStateStore } from "lib/Stores";
|
||||
|
||||
export let author: string | undefined = undefined;
|
||||
@@ -32,7 +33,7 @@
|
||||
}
|
||||
|
||||
async function openChannelOnTv() {
|
||||
// TODO:P1 open channel on TV
|
||||
await PlayletApi.openChannel(authorId);
|
||||
}
|
||||
|
||||
function openInvidiousInNewTab() {
|
||||
@@ -65,12 +66,12 @@
|
||||
<form method="dialog" class="modal-box bg-base-100">
|
||||
<h3 class="text-lg m-5">{author}</h3>
|
||||
<div class="flex flex-col">
|
||||
<!-- <button class="btn m-2" on:click={openChannelOnTv}
|
||||
>Open on {tvName}</button
|
||||
> -->
|
||||
<button class="btn m-2" on:click={openInvidiousInNewTab}
|
||||
>Open in Invidious</button
|
||||
>
|
||||
<button class="btn m-2" on:click={openChannelOnTv}>
|
||||
Open on {tvName}
|
||||
</button>
|
||||
<button class="btn m-2" on:click={openInvidiousInNewTab}>
|
||||
Open in Invidious
|
||||
</button>
|
||||
<button class="btn m-2">Cancel</button>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
@@ -55,6 +55,10 @@
|
||||
await PlayletApi.queuePlaylist(playlistId, title, videoCount);
|
||||
}
|
||||
|
||||
async function openPlaylistOnTv() {
|
||||
await PlayletApi.openPlaylist(playlistId);
|
||||
}
|
||||
|
||||
function openInvidiousInNewTab() {
|
||||
let url = `${invidiousInstance}/playlist?list=${playlistId}`;
|
||||
window.open(url);
|
||||
@@ -89,15 +93,18 @@
|
||||
<form method="dialog" class="modal-box bg-base-100">
|
||||
<h3 class="text-lg m-5">{title}</h3>
|
||||
<div class="flex flex-col">
|
||||
<button class="btn m-2" on:click={playPlaylistOnTv}
|
||||
>Play on {tvName}</button
|
||||
>
|
||||
<button class="btn m-2" on:click={queuePlaylistOnTv}
|
||||
>Queue on {tvName}
|
||||
<button class="btn m-2" on:click={playPlaylistOnTv}>
|
||||
Play on {tvName}
|
||||
</button>
|
||||
<button class="btn m-2" on:click={queuePlaylistOnTv}>
|
||||
Queue on {tvName}
|
||||
</button>
|
||||
<button class="btn m-2" on:click={openPlaylistOnTv}>
|
||||
Open on {tvName}
|
||||
</button>
|
||||
<button class="btn m-2" on:click={openInvidiousInNewTab}>
|
||||
Open in Invidious
|
||||
</button>
|
||||
<button class="btn m-2" on:click={openInvidiousInNewTab}
|
||||
>Open in Invidious</button
|
||||
>
|
||||
<button class="btn m-2">Cancel</button>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
Reference in new issue
Block a user