fix: 🐛 little last fixes before release

This commit is contained in:
Michel Roux 2024-03-05 11:39:16 +01:00
parent ffe1335ce0
commit 988069b6a6
4 changed files with 17 additions and 5 deletions

View File

@ -13,6 +13,7 @@
@click="modalEpisode = episode">
<template #actions>
<NcActionButton v-if="!isCurrentEpisode(episode)"
:aria-label="t('repod', 'Play')"
:name="t('repod', 'Play')"
:title="t('repod', 'Play')"
@click="load(episode)">
@ -21,6 +22,7 @@
</template>
</NcActionButton>
<NcActionButton v-if="isCurrentEpisode(episode)"
:aria-label="t('repod', 'Stop')"
:name="t('repod', 'Stop')"
:title="t('repod', 'Stop')"
@click="load(null)">
@ -32,6 +34,7 @@
<template #extra>
<NcActions>
<NcActionButton v-if="episode.duration && !hasEnded(episode)"
:aria-label="t('repod', 'Mark as read')"
:disabled="loadingAction"
:name="t('repod', 'Mark as read')"
:title="t('repod', 'Mark as read')"
@ -41,6 +44,7 @@
</template>
</NcActionButton>
<NcActionButton v-if="episode.duration && hasEnded(episode)"
:aria-label="t('repod', 'Mark as unread')"
:disabled="loadingAction"
:name="t('repod', 'Mark as unread')"
:title="t('repod', 'Mark as unread')"
@ -196,7 +200,9 @@ export default {
return this.currentEpisode && this.currentEpisode.url === episode.url
},
isListening(episode) {
return episode.action && episode.action.action === 'PLAY' && !this.hasEnded(episode)
return episode.action
&& episode.action.action.toLowerCase() === 'play'
&& !this.hasEnded(episode)
},
load(episode) {
this.$store.dispatch('player/load', episode)

View File

@ -49,5 +49,8 @@ export default {
return this.$store.state.settings.filters
},
},
mounted() {
this.$store.dispatch('settings/fetch')
},
}
</script>

View File

@ -3,7 +3,10 @@
:name="feed ? feed.title : url"
:to="hash">
<template #actions>
<NcActionButton :name="t(`core`, 'Delete')" @click="deleteSubscription">
<NcActionButton :aria-label="t(`core`, 'Delete')"
:name="t(`core`, 'Delete')"
:title="t(`core`, 'Delete')"
@click="deleteSubscription">
<template #icon>
<Delete :size="20" />
</template>

View File

@ -45,8 +45,8 @@ export const formatLocaleDate = (date) => date.toLocaleDateString(undefined, { d
*/
export const durationToSeconds = (duration) => {
const splitDuration = duration.split(':').reverse()
let seconds = splitDuration[0]
seconds += (splitDuration.length > 1) ? splitDuration[1] * 60 : 0
seconds += (splitDuration.length > 2) ? splitDuration[2] * 60 * 60 : 0
let seconds = parseInt(splitDuration[0])
seconds += (splitDuration.length > 1) ? parseInt(splitDuration[1]) * 60 : 0
seconds += (splitDuration.length > 2) ? parseInt(splitDuration[2]) * 60 * 60 : 0
return seconds
}