mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-08-05 13:46:21 +02:00
Fix to rate only books
This commit is contained in:
parent
89bd541247
commit
9a94b9b0c3
@ -248,7 +248,7 @@ export default {
|
|||||||
libraryItemUpdated(updatedLibraryItem) {
|
libraryItemUpdated(updatedLibraryItem) {
|
||||||
if (this.libraryItem && this.libraryItem.id === updatedLibraryItem.id) {
|
if (this.libraryItem && this.libraryItem.id === updatedLibraryItem.id) {
|
||||||
// The updated item from the server doesn't contain rating data, so we preserve it from the client-side model.
|
// The updated item from the server doesn't contain rating data, so we preserve it from the client-side model.
|
||||||
if (this.libraryItem.media) {
|
if (this.libraryItem.media && this.mediaType !== 'podcast') {
|
||||||
updatedLibraryItem.media = {
|
updatedLibraryItem.media = {
|
||||||
...(updatedLibraryItem.media || {}),
|
...(updatedLibraryItem.media || {}),
|
||||||
myRating: this.libraryItem.media.myRating,
|
myRating: this.libraryItem.media.myRating,
|
||||||
|
@ -225,7 +225,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div v-if="selectedMatchOrig.rating != null" class="flex items-center py-2">
|
<div v-if="selectedMatchOrig.rating != null && !isPodcast" class="flex items-center py-2">
|
||||||
<ui-checkbox v-model="selectedMatchUsage.rating" checkbox-bg="bg" @input="checkboxToggled" />
|
<ui-checkbox v-model="selectedMatchUsage.rating" checkbox-bg="bg" @input="checkboxToggled" />
|
||||||
<div class="grow ml-4">
|
<div class="grow ml-4">
|
||||||
<ui-rating-input v-model="selectedMatch.rating" :disabled="!selectedMatchUsage.rating" :label="$strings.LabelRating" />
|
<ui-rating-input v-model="selectedMatch.rating" :disabled="!selectedMatchUsage.rating" :label="$strings.LabelRating" />
|
||||||
@ -610,7 +610,7 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.selectedMatchUsage.rating && this.selectedMatchOrig.rating) {
|
if (this.selectedMatchUsage.rating && this.selectedMatchOrig.rating && !this.isPodcast) {
|
||||||
updatePayload.provider_data = {
|
updatePayload.provider_data = {
|
||||||
provider: this.provider,
|
provider: this.provider,
|
||||||
providerId: this.selectedMatchOrig.asin || this.selectedMatchOrig.id,
|
providerId: this.selectedMatchOrig.asin || this.selectedMatchOrig.id,
|
||||||
|
@ -59,7 +59,7 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="flex flex-wrap mt-2 -mx-1 items-end">
|
<div class="flex flex-wrap mt-2 -mx-1 items-end">
|
||||||
<div class="w-full md:w-1/2 px-1">
|
<div :class="isPodcast ? 'w-full px-1' : 'w-full md:w-1/2 px-1'">
|
||||||
<div class="flex -mx-1">
|
<div class="flex -mx-1">
|
||||||
<div class="w-1/2 px-1">
|
<div class="w-1/2 px-1">
|
||||||
<div class="flex justify-center">
|
<div class="flex justify-center">
|
||||||
@ -73,7 +73,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="w-full md:w-1/2 px-1 mt-2 md:mt-0">
|
<div v-if="!isPodcast" class="w-full md:w-1/2 px-1 mt-2 md:mt-0">
|
||||||
<div class="flex justify-center items-center">
|
<div class="flex justify-center items-center">
|
||||||
<label class="px-1 text-sm font-semibold mr-2">{{ $strings.LabelRating }}</label>
|
<label class="px-1 text-sm font-semibold mr-2">{{ $strings.LabelRating }}</label>
|
||||||
<ui-rating-input v-model="details.rating" @input="handleInputChange" />
|
<ui-rating-input v-model="details.rating" @input="handleInputChange" />
|
||||||
@ -128,6 +128,10 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
|
isPodcast() {
|
||||||
|
if (!this.libraryItem) return false
|
||||||
|
return this.libraryItem.mediaType === 'podcast'
|
||||||
|
},
|
||||||
media() {
|
media() {
|
||||||
return this.libraryItem ? this.libraryItem.media || {} : {}
|
return this.libraryItem ? this.libraryItem.media || {} : {}
|
||||||
},
|
},
|
||||||
@ -259,6 +263,7 @@ export default {
|
|||||||
checkForChanges() {
|
checkForChanges() {
|
||||||
var metadata = {}
|
var metadata = {}
|
||||||
for (const key in this.details) {
|
for (const key in this.details) {
|
||||||
|
if (this.isPodcast && key === 'rating') continue
|
||||||
var newValue = this.details[key]
|
var newValue = this.details[key]
|
||||||
var oldValue = this.mediaMetadata[key]
|
var oldValue = this.mediaMetadata[key]
|
||||||
// Key cleared out or key first populated
|
// Key cleared out or key first populated
|
||||||
|
@ -48,7 +48,7 @@
|
|||||||
<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>
|
||||||
|
|
||||||
<!-- RATING SECTION -->
|
<!-- RATING SECTION -->
|
||||||
<div v-if="serverSettings.enableRating" class="flex items-center space-x-4 mt-2">
|
<div v-if="serverSettings.enableRating && !isPodcast" class="flex items-center space-x-4 mt-2">
|
||||||
<div class="flex items-center">
|
<div class="flex items-center">
|
||||||
<ui-rating-input :value="myRating" :label="$strings.LabelYourRating" @input="updateRating" />
|
<ui-rating-input :value="myRating" :label="$strings.LabelYourRating" @input="updateRating" />
|
||||||
</div>
|
</div>
|
||||||
@ -67,7 +67,7 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- EXPLICIT RATING SECTION -->
|
<!-- EXPLICIT RATING SECTION -->
|
||||||
<div v-if="serverSettings.enableExplicitRating && isExplicit" class="flex items-center space-x-4 mt-3">
|
<div v-if="serverSettings.enableExplicitRating && isExplicit && !isPodcast" class="flex items-center space-x-4 mt-3">
|
||||||
<div class="flex items-center">
|
<div class="flex items-center">
|
||||||
<ui-rating-input :value="myExplicitRating" :label="$strings.LabelExplicitRating" icon="flame" @input="updateExplicitRating" />
|
<ui-rating-input :value="myExplicitRating" :label="$strings.LabelExplicitRating" icon="flame" @input="updateExplicitRating" />
|
||||||
</div>
|
</div>
|
||||||
|
@ -194,7 +194,7 @@
|
|||||||
"HeaderSettingsDisplay": "Display",
|
"HeaderSettingsDisplay": "Display",
|
||||||
"HeaderSettingsExperimental": "Experimental Features",
|
"HeaderSettingsExperimental": "Experimental Features",
|
||||||
"HeaderSettingsGeneral": "General",
|
"HeaderSettingsGeneral": "General",
|
||||||
"HeaderSettingsRatings": "Ratings",
|
"HeaderSettingsRatings": "Book Ratings",
|
||||||
"HeaderSettingsScanner": "Scanner",
|
"HeaderSettingsScanner": "Scanner",
|
||||||
"HeaderSettingsWebClient": "Web Client",
|
"HeaderSettingsWebClient": "Web Client",
|
||||||
"HeaderSleepTimer": "Sleep Timer",
|
"HeaderSleepTimer": "Sleep Timer",
|
||||||
|
Loading…
Reference in New Issue
Block a user