feat(snot): Add gridvid support, update Alfred integrations

This commit is contained in:
2026-08-11 09:50:55 +02:00
parent ec07e27924
commit 3cba11f1df
+22 -4
View File
@@ -208,6 +208,7 @@
<div x-show="playlistLink">
<a class="button" :href="playlistLink">Play all with mpv</a>
<a class="button" :href="gridLink">Play all in a grid</a>
</div>
<div class="filter-bar gapped small">
@@ -236,7 +237,7 @@
},
sort: { by: null, dir: "asc" },
buildAlfredURL(url) {
return `alfred://runtrigger/piracy/direct_link/?argument=${encodeURIComponent(url)}`;
return `alfred://runtrigger/dev.abdus.alfred.media/video/?argument=${encodeURIComponent(url)}`;
},
toggleSort(field) {
if (this.sort.by === field) {
@@ -320,7 +321,7 @@
await this.search();
}
},
get playlistLink() {
get playableURLs() {
const playable = this.visibleResults.some((item) => item.file_path.startsWith("/mnt/box/files"));
if (!playable) {
return null;
@@ -329,9 +330,26 @@
.filter((item) => item.file_path.startsWith("/mnt/box/files"))
.map((item) => item.download_url)
.sort(() => Math.random() - 0.5);
const playlistArg = encodeURIComponent(urls.join("\n"));
return `alfred://runtrigger/dev.abdus.labs/mpv_playlist/?argument=${playlistArg}`;
return urls;
},
get playlistLink() {
const urls = this.playableURLs;
if (!urls) {
return null;
}
const playlistArg = encodeURIComponent(urls.join("\n"));
return `alfred://runtrigger/dev.abdus.alfred.media/mpv/?argument=${playlistArg}`;
},
get gridLink() {
const urls = this.playableURLs;
if (!urls) {
return null;
}
const playlistArg = encodeURIComponent(urls.join("\n"));
return `alfred://runtrigger/dev.abdus.alfred.media/gridvid/?argument=${playlistArg}`;
},
async search() {
const response = await fetch("/search", {
method: "POST",