Migrate to vue3 (fix #126) #127

Merged
Xefir merged 32 commits from vue3 into main 2024-08-17 12:24:28 +00:00
4 changed files with 12 additions and 12 deletions
Showing only changes of commit 7efb0327d4 - Show all commits

View File

@ -18,7 +18,7 @@ export const usePlayer = defineStore('player', {
started: 0,
}),
actions: {
init: () => {
init() {
audio.ondurationchange = () => (this.duration = audio.duration)
audio.onended = () => this.stop()
audio.onloadeddata = () => (this.loaded = true)
@ -29,7 +29,7 @@ export const usePlayer = defineStore('player', {
audio.ontimeupdate = () => (this.currentTime = audio.currentTime)
audio.onvolumechange = () => (this.volume = audio.volume)
},
load: async (episode, podcastUrl) => {
async load(episode, podcastUrl) {
this.episode = episode
this.podcastUrl = podcastUrl
@ -63,24 +63,24 @@ export const usePlayer = defineStore('player', {
audio.src = ''
}
},
pause: () => {
pause() {
audio.pause()
this.paused = true
},
play: () => {
play() {
audio.play()
this.paused = false
this.started = audio.currentTime
},
seek: (currentTime) => {
seek(currentTime) {
audio.currentTime = currentTime
this.time()
},
stop: () => {
stop() {
this.pause()
this.episode = null
},
time: () => {
time() {
this.episode.action = {
podcast: this.podcastUrl,
episode: this.episode.url,
@ -95,10 +95,10 @@ export const usePlayer = defineStore('player', {
this.episode.action,
])
},
setVolume: (volume) => {
setVolume(volume) {
audio.volume = volume
},
setRate: (rate) => {
setRate(rate) {
audio.playbackRate = rate
},
},

View File

@ -10,7 +10,7 @@ export const useSettings = defineStore('settings', {
},
}),
actions: {
setFilters: (filters) => {
setFilters(filters) {
this.filters = { ...this.filters, ...filters }
setCookie('repod.filters', JSON.stringify(this.filters), 365)
},

View File

@ -7,7 +7,7 @@ export const useSubscriptions = defineStore('subscriptions', {
subscriptions: [],
}),
actions: {
fetch: async () => {
async fetch() {
const metrics = await axios.get(
generateUrl('/apps/gpoddersync/personal_settings/metrics'),
)

View File

@ -1,6 +1,6 @@
<template>
<AppContent class="main">
<NcTextField :label="t('repod', 'Find a podcast')" v-model="search">
<NcTextField v-model="search" :label="t('repod', 'Find a podcast')">
<template #icon>
<Magnify :size="20" />
</template>