more cleanup, better search

This commit is contained in:
2024-11-26 00:16:57 +00:00
parent 944ac08695
commit 81c4242735
16 changed files with 14 additions and 13 deletions

View File

@@ -4,7 +4,7 @@ WORKDIR /srv
COPY ./package.json ./package-lock.json /srv/
RUN npm install
COPY tsconfig.json tsconfig.app.json tsconfig.node.json vite.config.ts /srv/
COPY tsconfig.json tsconfig.app.json tsconfig.node.json vite.config.ts .env.development .env.production /srv/
COPY src /srv/src
COPY public /srv/public

View File

@@ -1,7 +1,7 @@
version: "3.7"
services:
gate:
image: registry.gitlab.com/standa-fifik/battle-caster:latest
image: registry.gitlab.com/standa-fifik/battle-caster:0.2.4
build:
context: .
dockerfile: Dockerfile

View File

@@ -96,7 +96,7 @@ function openPopover() {
}
function onDragover(event: DragEvent) {
const data = event.dataTransfer?.getData('application/json');
// const data = event.dataTransfer?.getData('application/json');
event.preventDefault();
}

View File

@@ -23,7 +23,7 @@
:class="{
'a-parallel__song--playing': song.isPlaying
}"
v-for="(song, idx) in node.sounds()"
v-for="(song) in node.sounds()"
:key="song.options.vFile.name"
@click="playTrack(song)"
>

View File

@@ -76,8 +76,12 @@ watch(search, async (value) => {
searchAbort.abort();
}
searchAbort = new AbortController();
let numberOfResults = 0;
for await (let result of fs.search(value, searchAbort.signal)) {
searchResults.value.push(result);
if (numberOfResults++ > 100) {
break;
}
}
});

View File

@@ -16,7 +16,7 @@ export class ParallelGroupNode extends SoundGroupNode<ParallelGroupNodeOptions,
}
play() {
this.soundNodes.forEach((sound, i) => {
this.soundNodes.forEach((sound) => {
if (this.enabledTracks.has(sound.id)) {
sound.play();
}

View File

@@ -146,7 +146,7 @@ export class MediaElementSoundNode extends SoundNode<MediaElementSoundNodeOption
this.mediaElement.addEventListener('ended', ()=> {
this._isPlaying = false;
});
this.mediaElement.addEventListener('playing', (event) => {
this.mediaElement.addEventListener('playing', () => {
this._isPlaying = true;
});
this.mediaElement.addEventListener('pause', () => {

View File

@@ -58,7 +58,7 @@ export class MountedFs implements Fs {
}
async *search(query: string, cancelToken?: AbortSignal) {
query = query.toLocaleLowerCase();
const queries: string[] = query.toLocaleLowerCase().split(' ');
for (const fs of this.filesystems.values()) {
const dirQueue = [fs.root];
while (dirQueue.length > 0) {
@@ -71,7 +71,7 @@ export class MountedFs implements Fs {
}
if (child.type === 'directory') {
dirQueue.push(child);
} else if (child.name.toLocaleLowerCase().includes(query)) {
} else if (queries.every((query) => [child.source, ...child.path].join('/').toLocaleLowerCase().includes(query))) {
yield child;
}
}

View File

@@ -126,7 +126,7 @@ export class WebRtcChannelSummon extends MessageEmitter implements JsonChannelSu
}
this.peer.ontrack = (event) => {
event.streams.forEach((stream) => {
stream.getTracks().forEach((track) => {
stream.getTracks().forEach(() => {
if (event.track.kind === 'audio') {
const audioElement = document.createElement('audio');
audioElement.srcObject = stream; // Attach the received stream

View File

@@ -107,7 +107,7 @@ const dynamicStyle = computed(() => {
});
function onVideoLoaded(event: Event) {
function onVideoLoaded() {
mediaDimensions.value = {
width: video.value!.videoWidth,
height: video.value!.videoHeight,

View File

@@ -15,9 +15,6 @@ export default defineConfig({
},
},
},
define: {
'import.meta.env.CHROMECAST_APP_ID': JSON.stringify(process.env.VITE_CHROMECAST_APP_ID)
},
plugins: [
vue({
template: {