Add: episode pubdate validation before saving

This commit is contained in:
Nicholas Wallace 2025-01-06 20:00:42 -07:00
parent 0eed38b771
commit 2ec84edb5e
3 changed files with 12 additions and 4 deletions

View File

@ -150,6 +150,12 @@ export default {
this.$toast.info(this.$strings.ToastNoUpdatesNecessary)
return false
}
// Check pubdate is valid if it is being updated. Cannot be set to null in the web client
if (updatedDetails.pubDate === null) {
this.$toast.error(this.$strings.ToastEpisodePubDateUpdateFailed)
return null
}
return this.updateDetails(updatedDetails)
},
async updateDetails(updatedDetails) {

View File

@ -1,9 +1,10 @@
<template>
<div class="w-full">
<slot>
<label :for="identifier" class="px-1 text-sm font-semibold" :class="{ 'text-gray-400': disabled }"
>{{ label }}<em v-if="note" class="font-normal text-xs pl-2">{{ note }}</em></label
>
<label :for="identifier" class="px-1 text-sm font-semibold" :class="{ 'text-gray-400': disabled }">
{{ label }}
<em v-if="note" class="font-normal text-xs pl-2">{{ note }}</em>
</label>
</slot>
<ui-text-input :placeholder="placeholder || label" :inputId="identifier" ref="input" v-model="inputValue" :disabled="disabled" :readonly="readonly" :type="type" class="w-full" :class="inputClass" @blur="inputBlurred" />
</div>

View File

@ -976,6 +976,7 @@
"ToastEpisodeDownloadQueueClearFailed": "Failed to clear queue",
"ToastEpisodeDownloadQueueClearSuccess": "Episode download queue cleared",
"ToastEpisodeUpdateSuccess": "{0} episodes updated",
"ToastEpisodePubDateUpdateFailed": "Publish date is required",
"ToastErrorCannotShare": "Cannot share natively on this device",
"ToastFailedToLoadData": "Failed to load data",
"ToastFailedToMatch": "Failed to match",