Skip to content

Commit 5353793

Browse files
feat: refactor player with state management
refactor(wip): playlist cache store feat: added waveform component feat: add config throttle
1 parent 77ecc05 commit 5353793

File tree

22 files changed

+558
-264
lines changed

22 files changed

+558
-264
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,5 +73,5 @@ Pull Requests: [Pull Requests](https://github.com/hexadecimal233/cloudie/pulls)
7373
- [ ] Scrobbling support
7474
- [ ] DJ Support
7575
- [ ] OEmbed Support
76-
76+
- [ ] Lyrics service
7777
-->

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
"buffer": "^6.0.3",
2929
"drizzle-orm": "^0.44.6",
3030
"hls.js": "^1.6.13",
31+
"pinia": "^3.0.4",
3132
"tailwindcss": "^4.1.13",
3233
"vue": "^3.5.13",
3334
"vue-final-modal": "^4.5.5",

pnpm-lock.yaml

Lines changed: 99 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/App.vue

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,7 @@
1010

1111
<div class="mx-4 flex items-center gap-2">
1212
<template v-if="!loading">
13-
<img
14-
:src="userInfo.avatar_url"
15-
alt="user"
16-
class="skeleton size-12 rounded-full object-contain ring" />
13+
<img :src="userInfo.avatar_url" alt="user" class="skeleton size-12 rounded-full object-contain ring" />
1714
<div class="text-lg font-bold">{{ userInfo.username }}</div>
1815
</template>
1916

@@ -83,15 +80,13 @@
8380
<button class="btn join-item" @click="$router.back()">
8481
<i-mdi-chevron-left />
8582
</button>
86-
<input
87-
type="text"
88-
:placeholder="$t('cloudie.main.searchBar')"
83+
<input type="text" :placeholder="$t('cloudie.main.searchBar')"
8984
class="input input-bordered join-item w-1/4" />
9085
</div>
9186
<div class="flex flex-col py-8">
9287
<span class="mb-4 text-3xl font-bold">
9388
<template v-if="$route.path !== '/'">
94-
{{ $t(`cloudie.main.${$route.path.slice(1)}`) }}
89+
{{ getPageTitle() }}
9590
</template>
9691
</span>
9792
<router-view v-slot="{ Component }">
@@ -111,13 +106,17 @@
111106

112107
<script setup lang="ts">
113108
import { onMounted, ref } from "vue"
109+
import { useRoute } from "vue-router"
110+
import { useI18n } from "vue-i18n"
114111
import { BasicUserInfo, updateUserInfo, userInfo } from "@/utils/api"
115112
import { Toaster } from "vue-sonner"
116113
import { ModalsContainer } from "vue-final-modal"
117114
import "vue-sonner/style.css"
118115
import "vue-final-modal/style.css"
119116
import AudioPlayer from "./components/AudioPlayer.vue"
120117
118+
const route = useRoute()
119+
const i18n = useI18n()
121120
const user = ref<BasicUserInfo>()
122121
const loading = ref(true)
123122
@@ -126,4 +125,13 @@ onMounted(async () => {
126125
user.value = userInfo.value
127126
loading.value = false
128127
})
128+
129+
function getPageTitle() {
130+
const path = route.path
131+
const pathSegments = path.split("/").filter(Boolean)
132+
133+
// Handle dynamic routes by using only the first segment (e.g., /playlist/:id)
134+
const firstSegment = pathSegments[0]
135+
return i18n.t(`cloudie.main.${firstSegment}`)
136+
}
129137
</script>

src/assets/i18n/en.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
"searchBar": "Search (unimplemented yet)",
66
"likes": "Likes",
77
"playlists": "Playlists & Albums",
8+
"playlist": "Playlist",
89
"radio": "Radio",
910
"history": "Play History",
1011
"downloads": "Downloads",

0 commit comments

Comments
 (0)