fix: 🐛 fix prototype with async
This commit is contained in:
parent
81af0c219f
commit
7efb0327d4
@ -18,7 +18,7 @@ export const usePlayer = defineStore('player', {
|
|||||||
started: 0,
|
started: 0,
|
||||||
}),
|
}),
|
||||||
actions: {
|
actions: {
|
||||||
init: () => {
|
init() {
|
||||||
audio.ondurationchange = () => (this.duration = audio.duration)
|
audio.ondurationchange = () => (this.duration = audio.duration)
|
||||||
audio.onended = () => this.stop()
|
audio.onended = () => this.stop()
|
||||||
audio.onloadeddata = () => (this.loaded = true)
|
audio.onloadeddata = () => (this.loaded = true)
|
||||||
@ -29,7 +29,7 @@ export const usePlayer = defineStore('player', {
|
|||||||
audio.ontimeupdate = () => (this.currentTime = audio.currentTime)
|
audio.ontimeupdate = () => (this.currentTime = audio.currentTime)
|
||||||
audio.onvolumechange = () => (this.volume = audio.volume)
|
audio.onvolumechange = () => (this.volume = audio.volume)
|
||||||
},
|
},
|
||||||
load: async (episode, podcastUrl) => {
|
async load(episode, podcastUrl) {
|
||||||
this.episode = episode
|
this.episode = episode
|
||||||
this.podcastUrl = podcastUrl
|
this.podcastUrl = podcastUrl
|
||||||
|
|
||||||
@ -63,24 +63,24 @@ export const usePlayer = defineStore('player', {
|
|||||||
audio.src = ''
|
audio.src = ''
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
pause: () => {
|
pause() {
|
||||||
audio.pause()
|
audio.pause()
|
||||||
this.paused = true
|
this.paused = true
|
||||||
},
|
},
|
||||||
play: () => {
|
play() {
|
||||||
audio.play()
|
audio.play()
|
||||||
this.paused = false
|
this.paused = false
|
||||||
this.started = audio.currentTime
|
this.started = audio.currentTime
|
||||||
},
|
},
|
||||||
seek: (currentTime) => {
|
seek(currentTime) {
|
||||||
audio.currentTime = currentTime
|
audio.currentTime = currentTime
|
||||||
this.time()
|
this.time()
|
||||||
},
|
},
|
||||||
stop: () => {
|
stop() {
|
||||||
this.pause()
|
this.pause()
|
||||||
this.episode = null
|
this.episode = null
|
||||||
},
|
},
|
||||||
time: () => {
|
time() {
|
||||||
this.episode.action = {
|
this.episode.action = {
|
||||||
podcast: this.podcastUrl,
|
podcast: this.podcastUrl,
|
||||||
episode: this.episode.url,
|
episode: this.episode.url,
|
||||||
@ -95,10 +95,10 @@ export const usePlayer = defineStore('player', {
|
|||||||
this.episode.action,
|
this.episode.action,
|
||||||
])
|
])
|
||||||
},
|
},
|
||||||
setVolume: (volume) => {
|
setVolume(volume) {
|
||||||
audio.volume = volume
|
audio.volume = volume
|
||||||
},
|
},
|
||||||
setRate: (rate) => {
|
setRate(rate) {
|
||||||
audio.playbackRate = rate
|
audio.playbackRate = rate
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -10,7 +10,7 @@ export const useSettings = defineStore('settings', {
|
|||||||
},
|
},
|
||||||
}),
|
}),
|
||||||
actions: {
|
actions: {
|
||||||
setFilters: (filters) => {
|
setFilters(filters) {
|
||||||
this.filters = { ...this.filters, ...filters }
|
this.filters = { ...this.filters, ...filters }
|
||||||
setCookie('repod.filters', JSON.stringify(this.filters), 365)
|
setCookie('repod.filters', JSON.stringify(this.filters), 365)
|
||||||
},
|
},
|
||||||
|
@ -7,7 +7,7 @@ export const useSubscriptions = defineStore('subscriptions', {
|
|||||||
subscriptions: [],
|
subscriptions: [],
|
||||||
}),
|
}),
|
||||||
actions: {
|
actions: {
|
||||||
fetch: async () => {
|
async fetch() {
|
||||||
const metrics = await axios.get(
|
const metrics = await axios.get(
|
||||||
generateUrl('/apps/gpoddersync/personal_settings/metrics'),
|
generateUrl('/apps/gpoddersync/personal_settings/metrics'),
|
||||||
)
|
)
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<AppContent class="main">
|
<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>
|
<template #icon>
|
||||||
<Magnify :size="20" />
|
<Magnify :size="20" />
|
||||||
</template>
|
</template>
|
||||||
|
Loading…
Reference in New Issue
Block a user