mirror of
https://github.com/imputnet/cobalt.git
synced 2025-12-14 12:15:21 +00:00
merge: 10.7.3 from main
Some checks failed
CodeQL / Analyze (${{ matrix.language }}) (none, javascript-typescript) (push) Waiting to run
Run tests / check lockfile correctness (push) Waiting to run
Run tests / web sanity check (push) Waiting to run
Run tests / api sanity check (push) Waiting to run
Run service tests / test service functionality (push) Has been cancelled
Run service tests / test service: ${{ matrix.service }} (push) Has been cancelled
Some checks failed
CodeQL / Analyze (${{ matrix.language }}) (none, javascript-typescript) (push) Waiting to run
Run tests / check lockfile correctness (push) Waiting to run
Run tests / web sanity check (push) Waiting to run
Run tests / api sanity check (push) Waiting to run
Run service tests / test service functionality (push) Has been cancelled
Run service tests / test service: ${{ matrix.service }} (push) Has been cancelled
This commit is contained in:
@@ -50,7 +50,9 @@
|
||||
<div class="picker-body">
|
||||
{#if items}
|
||||
{#each items as item, i}
|
||||
<PickerItem {item} number={i + 1} />
|
||||
{#if item?.url}
|
||||
<PickerItem {item} number={i + 1} />
|
||||
{/if}
|
||||
{/each}
|
||||
{/if}
|
||||
</div>
|
||||
|
||||
@@ -14,18 +14,28 @@
|
||||
export let number: number;
|
||||
|
||||
let imageLoaded = false;
|
||||
const isTunnel = new URL(item.url).pathname === "/tunnel";
|
||||
|
||||
let validUrl = false;
|
||||
try {
|
||||
new URL(item.url);
|
||||
validUrl = true;
|
||||
} catch {}
|
||||
|
||||
const isTunnel = validUrl && new URL(item.url).pathname === "/tunnel";
|
||||
|
||||
$: itemType = item.type ?? "photo";
|
||||
</script>
|
||||
|
||||
<button
|
||||
class="picker-item"
|
||||
on:click={() =>
|
||||
downloadFile({
|
||||
url: item.url,
|
||||
urlType: isTunnel ? "tunnel" : "redirect",
|
||||
})}
|
||||
on:click={() => {
|
||||
if (validUrl) {
|
||||
downloadFile({
|
||||
url: item.url,
|
||||
urlType: isTunnel ? "tunnel" : "redirect",
|
||||
});
|
||||
}
|
||||
}}
|
||||
>
|
||||
<div class="picker-type">
|
||||
{#if itemType === "video"}
|
||||
|
||||
@@ -72,6 +72,9 @@ export const youtubeLanguages = [
|
||||
"ur",
|
||||
"uz",
|
||||
"vi",
|
||||
"zh",
|
||||
"zh-Hans",
|
||||
"zh-Hant",
|
||||
"zh-CN",
|
||||
"zh-HK",
|
||||
"zh-TW",
|
||||
|
||||
Reference in New Issue
Block a user