mirror of
https://github.com/Dvorinka/swingmusic-extended.git
synced 2026-06-04 04:23:01 +00:00
add more bugs
This commit is contained in:
@@ -3,6 +3,7 @@ import { watch } from "@vue/runtime-core";
|
||||
|
||||
import media from "./mediaNotification.js";
|
||||
import state from "./state.js";
|
||||
import playAudio from "./playAudio.js";
|
||||
|
||||
const current = ref(state.current);
|
||||
|
||||
@@ -107,14 +108,27 @@ setTimeout(() => {
|
||||
});
|
||||
}, 1000);
|
||||
|
||||
window.addEventListener("keyup", (e) => {
|
||||
e.preventDefault();
|
||||
var _key_down_fired = false;
|
||||
|
||||
window.addEventListener("keydown", (e) => {
|
||||
|
||||
if (e.ctrlKey && e.code == "KeyF") {
|
||||
if (e.code == "Space" && !_key_down_fired) {
|
||||
e.stopImmediatePropagation();
|
||||
e.preventDefault();
|
||||
playAudio.playPause();
|
||||
_key_down_fired = true;
|
||||
|
||||
} else if (e.ctrlKey && e.code == "KeyF") {
|
||||
console.log('Ctrl F')
|
||||
}
|
||||
});
|
||||
|
||||
window.addEventListener("keyup", (e) => {
|
||||
if (e.code == "Space") {
|
||||
_key_down_fired = false;
|
||||
}
|
||||
})
|
||||
|
||||
export default {
|
||||
putCommas,
|
||||
readQueue,
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
import state from "./state.js";
|
||||
|
||||
const base_url = "http://127.0.0.1:9876/search?q=";
|
||||
|
||||
async function search(query) {
|
||||
const url = base_url + query;
|
||||
|
||||
const res = await fetch(url);
|
||||
const json = await res.json();
|
||||
state.search_tracks.value = json.songs;
|
||||
state.search_albums.value = json.albums;
|
||||
state.search_artists.value = json.artists;
|
||||
console.log(state.search);
|
||||
}
|
||||
|
||||
export default search;
|
||||
@@ -34,6 +34,9 @@ const loading = ref(false);
|
||||
|
||||
const is_playing = ref(false);
|
||||
|
||||
const search_tracks = ref([]);
|
||||
const search_albums = ref([]);
|
||||
const search_artists = ref([]);
|
||||
|
||||
export default {
|
||||
search_query,
|
||||
@@ -44,4 +47,7 @@ export default {
|
||||
magic_flag,
|
||||
loading,
|
||||
is_playing,
|
||||
search_tracks,
|
||||
search_albums,
|
||||
search_artists,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user