Parse metadata lines on tv feeds

This commit is contained in:
Brahim Hadriche committed 2025-05-15 21:50:40 -04:00
1 parent 4fc44becd2
commit 227a5157a5
8 files changed
+82 -12

No files matched your search

@@ -12,6 +12,7 @@
export let videoCountText: string | undefined = undefined;
export let videos: any[] | undefined = undefined;
export let updated: number | undefined = undefined;
export let lines: string[] | undefined = undefined;
// svelte-ignore unused-export-let
export let type: string = undefined;
@@ -96,8 +97,10 @@
/>
<div class="card-body">
<h3 class="card-title text-base line-clamp-2 min-h-12">{title}</h3>
<div class="font-semibold">{author}</div>
<div>{getUpdatedText()}</div>
<div class="font-semibold">
{author || (lines?.length > 0 ? lines[0] : "")}
</div>
<div>{getUpdatedText() || (lines?.length > 1 ? lines[1] : "")}</div>
</div>
</div>
</button>
+12 -4
View File
@@ -18,6 +18,7 @@
export let lengthSeconds: number = undefined;
export let lengthText: string | undefined = undefined;
export let liveNow: boolean = undefined;
export let lines: string[] | undefined = undefined;
// svelte-ignore unused-export-let
export let type: string = undefined;
@@ -179,6 +180,13 @@
return trFn("1 minute ago");
}
}
function openChannelModal() {
if (!authorId) {
return;
}
channelModal.show();
}
</script>
<button
@@ -208,18 +216,18 @@
tabindex="0"
on:click={(e) => {
e.stopPropagation();
channelModal.show();
openChannelModal();
}}
on:keydown={(e) => {
if (e.key === "Enter" || e.key === " ") {
e.preventDefault();
channelModal.show();
openChannelModal();
}
}}
>
{author || ""}
{author || (lines?.length > 0 ? lines[0] : "")}
</span>
<div>{getViewCountDateText()}</div>
<div>{getViewCountDateText() || (lines?.length > 1 ? lines[1] : "")}</div>
</div>
</div>
</button>