diff --git a/anime/routes.py b/anime/routes.py
index fc34140..51d0f2d 100644
--- a/anime/routes.py
+++ b/anime/routes.py
@@ -51,8 +51,6 @@ def start_watching(request: Request) -> None:
cwd=anime_dir,
)
request.app.state.pid = ret.pid
- ret.wait()
- request.app.state.pid = None
@router.post("/player/offset")
diff --git a/frontend/src/components/PlayerComponent.vue b/frontend/src/components/PlayerComponent.vue
index 3e75a5a..fcf01dc 100644
--- a/frontend/src/components/PlayerComponent.vue
+++ b/frontend/src/components/PlayerComponent.vue
@@ -1,40 +1,29 @@
-
+
diff --git a/frontend/src/stores/backendState.js b/frontend/src/stores/backendState.js
new file mode 100644
index 0000000..dc5af41
--- /dev/null
+++ b/frontend/src/stores/backendState.js
@@ -0,0 +1,25 @@
+import { defineStore } from "pinia";
+import { ref } from 'vue'
+
+export const useBackendStateStore = defineStore('backendState', () => {
+ const backendState = ref({
+ canWatch: false,
+ playing: false
+ })
+
+ async function updateCanWatch() {
+ const response = await fetch("/api/can-start-watching");
+ backendState.value.canWatch = response.ok;
+ }
+
+
+ async function updatePlaying() {
+ const response = await fetch('/api/player/playing');
+ if (response.ok) {
+ let resp_json = await response.json()
+ backendState.value.playing = resp_json.playing
+ }
+ }
+
+ return { backendState, updateCanWatch, updatePlaying }
+});
\ No newline at end of file
diff --git a/frontend/src/stores/counter.js b/frontend/src/stores/counter.js
deleted file mode 100644
index b6757ba..0000000
--- a/frontend/src/stores/counter.js
+++ /dev/null
@@ -1,12 +0,0 @@
-import { ref, computed } from 'vue'
-import { defineStore } from 'pinia'
-
-export const useCounterStore = defineStore('counter', () => {
- const count = ref(0)
- const doubleCount = computed(() => count.value * 2)
- function increment() {
- count.value++
- }
-
- return { count, doubleCount, increment }
-})
diff --git a/frontend/src/utils/index.js b/frontend/src/utils/index.js
index 177de7a..33663f8 100644
--- a/frontend/src/utils/index.js
+++ b/frontend/src/utils/index.js
@@ -1,4 +1,5 @@
import { showFailToast } from 'vant';
+import { usePlayingStore } from '@/stores/playing';
async function postRequest(url, data) {
const response = await fetch(url, {
@@ -17,7 +18,6 @@ async function postRequest(url, data) {
return resp_data
}
-
export {
- postRequest
+ postRequest,
}
\ No newline at end of file
diff --git a/frontend/src/views/HomeView.vue b/frontend/src/views/HomeView.vue
index f19dba1..1a63b6c 100644
--- a/frontend/src/views/HomeView.vue
+++ b/frontend/src/views/HomeView.vue
@@ -1,21 +1,23 @@
@@ -23,7 +25,8 @@ async function startWatching() {
-