toggle switch off by default

This commit is contained in:
danny.rich 2025-12-01 14:43:06 -05:00
parent 35862aec9b
commit 4b83e740c1
7 changed files with 28 additions and 2 deletions

View file

@ -78,6 +78,9 @@ export default {
bookCovers() { bookCovers() {
return this.book.covers || [] return this.book.covers || []
}, },
serverSettings() {
return this.$store.state.serverSettings
},
bookDuration() { bookDuration() {
return (this.book.duration || 0) * 60 return (this.book.duration || 0) * 60
}, },

View file

@ -111,7 +111,7 @@ export default {
value: 'media.metadata.publishedYear' value: 'media.metadata.publishedYear'
}, },
{ {
text: 'Rating', text: this.$strings.LabelRating,
value: 'media.metadata.rating' value: 'media.metadata.rating'
}, },
{ {

View file

@ -336,6 +336,9 @@ export default {
bookCoverAspectRatio() { bookCoverAspectRatio() {
return this.$store.getters['libraries/getBookCoverAspectRatio'] return this.$store.getters['libraries/getBookCoverAspectRatio']
}, },
serverSettings() {
return this.$store.state.serverSettings
},
filterData() { filterData() {
return this.$store.state.libraries.filterData || {} return this.$store.state.libraries.filterData || {}
}, },

View file

@ -130,6 +130,16 @@
</ui-tooltip> </ui-tooltip>
</div> </div>
<div role="article" :aria-label="$strings.LabelSettingsEnableBookRatingsHelp" class="flex items-center py-2">
<ui-toggle-switch :label="$strings.LabelSettingsEnableBookRatings" v-model="newServerSettings.enableBookRatings" :disabled="updatingServerSettings" @input="(val) => updateSettingsKey('enableBookRatings', val)" />
<ui-tooltip aria-hidden="true" :text="$strings.LabelSettingsEnableBookRatingsHelp">
<p class="pl-4">
<span id="settings-enable-book-ratings">{{ $strings.LabelSettingsEnableBookRatings }}</span>
<span class="material-symbols icon-text">info</span>
</p>
</ui-tooltip>
</div>
<div class="grow py-2"> <div class="grow py-2">
<ui-dropdown :label="$strings.LabelSettingsDateFormat" v-model="newServerSettings.dateFormat" :items="dateFormats" small class="max-w-72" @input="(val) => updateSettingsKey('dateFormat', val)" /> <ui-dropdown :label="$strings.LabelSettingsDateFormat" v-model="newServerSettings.dateFormat" :items="dateFormats" small class="max-w-72" @input="(val) => updateSettingsKey('dateFormat', val)" />
<p class="text-xs ml-1 text-white/60">{{ $strings.LabelExample }}: {{ dateExample }}</p> <p class="text-xs ml-1 text-white/60">{{ $strings.LabelExample }}: {{ dateExample }}</p>

View file

@ -45,7 +45,7 @@
</p> </p>
<p v-else class="mb-2 mt-0.5 text-gray-200 text-xl">by Unknown</p> <p v-else class="mb-2 mt-0.5 text-gray-200 text-xl">by Unknown</p>
<div v-if="ratingValue > 0 && !isPodcast" class="flex items-center mb-2 mt-1"> <div v-if="ratingValue > 0 && !isPodcast && serverSettings.enableBookRatings" class="flex items-center mb-2 mt-1">
<span v-for="i in 5" :key="i" class="material-symbols text-sm mr-0.5" :class="ratingValue >= i - 0.5 ? 'text-warning fill' : 'text-gray-500'">{{ ratingValue >= i ? 'star' : ratingValue >= i - 0.5 ? 'star_half' : 'star_border' }}</span> <span v-for="i in 5" :key="i" class="material-symbols text-sm mr-0.5" :class="ratingValue >= i - 0.5 ? 'text-warning fill' : 'text-gray-500'">{{ ratingValue >= i ? 'star' : ratingValue >= i - 0.5 ? 'star_half' : 'star_border' }}</span>
<span class="ml-1 text-gray-300">{{ ratingValue.toFixed(1) }}</span> <span class="ml-1 text-gray-300">{{ ratingValue.toFixed(1) }}</span>
</div> </div>
@ -203,6 +203,9 @@ export default {
userIsAdminOrUp() { userIsAdminOrUp() {
return this.$store.getters['user/getIsAdminOrUp'] return this.$store.getters['user/getIsAdminOrUp']
}, },
serverSettings() {
return this.$store.state.serverSettings
},
bookCoverAspectRatio() { bookCoverAspectRatio() {
return this.$store.getters['libraries/getBookCoverAspectRatio'] return this.$store.getters['libraries/getBookCoverAspectRatio']
}, },

View file

@ -545,6 +545,7 @@
"LabelRSSFeedSlug": "RSS Feed Slug", "LabelRSSFeedSlug": "RSS Feed Slug",
"LabelRSSFeedURL": "RSS Feed URL", "LabelRSSFeedURL": "RSS Feed URL",
"LabelRandomly": "Randomly", "LabelRandomly": "Randomly",
"LabelRating": "Rating",
"LabelReAddSeriesToContinueListening": "Re-add series to Continue Listening", "LabelReAddSeriesToContinueListening": "Re-add series to Continue Listening",
"LabelRead": "Read", "LabelRead": "Read",
"LabelReadAgain": "Read Again", "LabelReadAgain": "Read Again",
@ -593,8 +594,11 @@
"LabelSettingsEnableWatcherHelp": "Enables the automatic adding/updating of items when file changes are detected. *Requires server restart", "LabelSettingsEnableWatcherHelp": "Enables the automatic adding/updating of items when file changes are detected. *Requires server restart",
"LabelSettingsEpubsAllowScriptedContent": "Allow scripted content in epubs", "LabelSettingsEpubsAllowScriptedContent": "Allow scripted content in epubs",
"LabelSettingsEpubsAllowScriptedContentHelp": "Allow epub files to execute scripts. It is recommended to keep this setting disabled unless you trust the source of the epub files.", "LabelSettingsEpubsAllowScriptedContentHelp": "Allow epub files to execute scripts. It is recommended to keep this setting disabled unless you trust the source of the epub files.",
"LabelSettingsEnableBookRatings": "Enable book ratings",
"LabelSettingsExperimentalFeatures": "Experimental features", "LabelSettingsExperimentalFeatures": "Experimental features",
"LabelSettingsExperimentalFeaturesHelp": "Features in development that could use your feedback and help testing. Click to open github discussion.", "LabelSettingsExperimentalFeaturesHelp": "Features in development that could use your feedback and help testing. Click to open github discussion.",
"LabelSettingsEnableBookRatings": "Show star ratings on book page",
"LabelSettingsEnableBookRatingsHelp": "Show star ratings on the book details page when available.",
"LabelSettingsFindCovers": "Find covers", "LabelSettingsFindCovers": "Find covers",
"LabelSettingsFindCoversHelp": "If your audiobook does not have an embedded cover or a cover image inside the folder, the scanner will attempt to find a cover.<br>Note: This will extend scan time", "LabelSettingsFindCoversHelp": "If your audiobook does not have an embedded cover or a cover image inside the folder, the scanner will attempt to find a cover.<br>Note: This will extend scan time",
"LabelSettingsHideSingleBookSeries": "Hide single book series", "LabelSettingsHideSingleBookSeries": "Hide single book series",

View file

@ -40,6 +40,7 @@ class ServerSettings {
// Bookshelf Display // Bookshelf Display
this.homeBookshelfView = BookshelfView.DETAIL this.homeBookshelfView = BookshelfView.DETAIL
this.bookshelfView = BookshelfView.DETAIL this.bookshelfView = BookshelfView.DETAIL
this.enableBookRatings = false
// Podcasts // Podcasts
this.podcastEpisodeSchedule = '0 * * * *' // Every hour this.podcastEpisodeSchedule = '0 * * * *' // Every hour
@ -114,6 +115,7 @@ class ServerSettings {
this.homeBookshelfView = settings.homeBookshelfView || BookshelfView.STANDARD this.homeBookshelfView = settings.homeBookshelfView || BookshelfView.STANDARD
this.bookshelfView = settings.bookshelfView || BookshelfView.STANDARD this.bookshelfView = settings.bookshelfView || BookshelfView.STANDARD
this.enableBookRatings = !!settings.enableBookRatings
this.sortingIgnorePrefix = !!settings.sortingIgnorePrefix this.sortingIgnorePrefix = !!settings.sortingIgnorePrefix
this.sortingPrefixes = settings.sortingPrefixes || ['the'] this.sortingPrefixes = settings.sortingPrefixes || ['the']
@ -226,6 +228,7 @@ class ServerSettings {
loggerScannerLogsToKeep: this.loggerScannerLogsToKeep, loggerScannerLogsToKeep: this.loggerScannerLogsToKeep,
homeBookshelfView: this.homeBookshelfView, homeBookshelfView: this.homeBookshelfView,
bookshelfView: this.bookshelfView, bookshelfView: this.bookshelfView,
enableBookRatings: this.enableBookRatings,
podcastEpisodeSchedule: this.podcastEpisodeSchedule, podcastEpisodeSchedule: this.podcastEpisodeSchedule,
sortingIgnorePrefix: this.sortingIgnorePrefix, sortingIgnorePrefix: this.sortingIgnorePrefix,
sortingPrefixes: [...this.sortingPrefixes], sortingPrefixes: [...this.sortingPrefixes],