mirror of
https://github.com/mollersuite/monofile.git
synced 2024-11-21 13:36:25 -08:00
Audio previews
This commit is contained in:
parent
eb6d06cf25
commit
f43162abef
|
@ -166,7 +166,11 @@ app.get("/download/:fileId",(req,res) => {
|
|||
: (
|
||||
file.mime.startsWith("video/")
|
||||
? `<div style="min-height:10px"></div><video src="/file/${req.params.fileId}" controls></video>`
|
||||
: ""
|
||||
: (
|
||||
file.mime.startsWith("audio/")
|
||||
? `<div style="min-height:10px"></div><audio src="/file/${req.params.fileId}" controls></audio>`
|
||||
: ""
|
||||
)
|
||||
)
|
||||
)
|
||||
.replace(/\$Uploader/g,!file.owner||file.visibility=="anonymous" ? "Anonymous" : `@${Accounts.getFromId(file.owner)?.username || "Deleted User"}`)
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
}
|
||||
|
||||
#uploadWindow {
|
||||
img, video {
|
||||
img, video, audio {
|
||||
width:100%;
|
||||
}
|
||||
}
|
|
@ -8,6 +8,7 @@
|
|||
import OptionPicker from "../prompts/OptionPicker.svelte";
|
||||
|
||||
let picker;
|
||||
let query = "";
|
||||
|
||||
fetchFilePointers();
|
||||
</script>
|
||||
|
@ -25,10 +26,11 @@
|
|||
</div>
|
||||
{:else}
|
||||
<div class="loggedIn">
|
||||
<input type="text" placeholder={`Search ${$files.length} file(s)`} class="searchBar">
|
||||
<input type="text" placeholder={`Search ${$files.length} file(s)`} class="searchBar" bind:value={query}>
|
||||
|
||||
<div class="fileList">
|
||||
{#each $files as file (file.id)}
|
||||
<!-- Probably wildly inefficient but who cares, I just wanna get this over with -->
|
||||
{#each $files.filter(f => f.name.toLowerCase().includes(query.toLowerCase()) || f.id.toLowerCase().includes(query.toLowerCase()) || f.tag.includes(query.toLowerCase())) as file (file.id)}
|
||||
<div class="flFile" transition:fade={{duration:200}} animate:flip={{duration:200}}>
|
||||
<button class="hitbox" on:click={window.open(`/download/${file.id}`)}></button> <!-- this is bad, but I'm lazy -->
|
||||
<div class="flexCont">
|
||||
|
|
Loading…
Reference in a new issue