feat(snot): Add gridvid support, update Alfred integrations
This commit is contained in:
+22
-4
@@ -208,6 +208,7 @@
|
|||||||
|
|
||||||
<div x-show="playlistLink">
|
<div x-show="playlistLink">
|
||||||
<a class="button" :href="playlistLink">Play all with mpv</a>
|
<a class="button" :href="playlistLink">Play all with mpv</a>
|
||||||
|
<a class="button" :href="gridLink">Play all in a grid</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="filter-bar gapped small">
|
<div class="filter-bar gapped small">
|
||||||
@@ -236,7 +237,7 @@
|
|||||||
},
|
},
|
||||||
sort: { by: null, dir: "asc" },
|
sort: { by: null, dir: "asc" },
|
||||||
buildAlfredURL(url) {
|
buildAlfredURL(url) {
|
||||||
return `alfred://runtrigger/piracy/direct_link/?argument=${encodeURIComponent(url)}`;
|
return `alfred://runtrigger/dev.abdus.alfred.media/video/?argument=${encodeURIComponent(url)}`;
|
||||||
},
|
},
|
||||||
toggleSort(field) {
|
toggleSort(field) {
|
||||||
if (this.sort.by === field) {
|
if (this.sort.by === field) {
|
||||||
@@ -320,7 +321,7 @@
|
|||||||
await this.search();
|
await this.search();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
get playlistLink() {
|
get playableURLs() {
|
||||||
const playable = this.visibleResults.some((item) => item.file_path.startsWith("/mnt/box/files"));
|
const playable = this.visibleResults.some((item) => item.file_path.startsWith("/mnt/box/files"));
|
||||||
if (!playable) {
|
if (!playable) {
|
||||||
return null;
|
return null;
|
||||||
@@ -329,9 +330,26 @@
|
|||||||
.filter((item) => item.file_path.startsWith("/mnt/box/files"))
|
.filter((item) => item.file_path.startsWith("/mnt/box/files"))
|
||||||
.map((item) => item.download_url)
|
.map((item) => item.download_url)
|
||||||
.sort(() => Math.random() - 0.5);
|
.sort(() => Math.random() - 0.5);
|
||||||
const playlistArg = encodeURIComponent(urls.join("\n"));
|
return urls;
|
||||||
return `alfred://runtrigger/dev.abdus.labs/mpv_playlist/?argument=${playlistArg}`;
|
|
||||||
},
|
},
|
||||||
|
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() {
|
async search() {
|
||||||
const response = await fetch("/search", {
|
const response = await fetch("/search", {
|
||||||
method: "POST",
|
method: "POST",
|
||||||
|
|||||||
Reference in New Issue
Block a user