From f4fc4b52e3b2edb16858a1aa69f475b0b1e365d2 Mon Sep 17 00:00:00 2001 From: Michel Roux Date: Tue, 16 Jan 2024 23:13:07 +0100 Subject: [PATCH] fix: started state and decodeUrl --- src/store/player.js | 9 +++++++-- src/views/Feed.vue | 3 ++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/store/player.js b/src/store/player.js index bebe25f..b92bac6 100644 --- a/src/store/player.js +++ b/src/store/player.js @@ -1,4 +1,5 @@ import axios from '@nextcloud/axios' +import { decodeUrl } from '../utils/url.js' import { generateUrl } from '@nextcloud/router' import moment from '@nextcloud/moment' import router from '../router.js' @@ -25,8 +26,8 @@ export const player = { paused: null, podcastUrl: null, volume: 1, - started: 0, rate: 1, + started: 0, }, mutations: { action: (state, action) => { @@ -47,13 +48,14 @@ export const player = { state.episode = episode if (episode) { - state.podcastUrl = atob(router.currentRoute.params.url) + state.podcastUrl = decodeUrl(router.currentRoute.params.url) audio.src = episode.url audio.load() audio.play() if (episode.action && episode.action.position && episode.action.position < episode.action.total) { audio.currentTime = episode.action.position + state.started = audio.currentTime } } else { state.loaded = false @@ -73,6 +75,9 @@ export const player = { rate: (state, rate) => { state.rate = rate }, + started: (state, started) => { + state.started = started + }, }, actions: { load: async (context, episode) => { diff --git a/src/views/Feed.vue b/src/views/Feed.vue index 7f1e4f4..8198483 100644 --- a/src/views/Feed.vue +++ b/src/views/Feed.vue @@ -26,6 +26,7 @@ import Episodes from '../components/Feed/Episodes.vue' import Loading from '../components/Atoms/Loading.vue' import { NcEmptyContent } from '@nextcloud/vue' import axios from '@nextcloud/axios' +import { decodeUrl } from '../utils/url.js' import { generateUrl } from '@nextcloud/router' export default { @@ -47,7 +48,7 @@ export default { }, computed: { url() { - return atob(this.$route.params.url) + return decodeUrl(this.$route.params.url) }, }, async mounted() {