fix(webui): display series/books as unavailable if library is unavailable

closes #617
This commit is contained in:
Gauthier Roebroeck 2021-08-16 14:43:19 +08:00
parent 871ec60869
commit 82cf82df38
5 changed files with 20 additions and 6 deletions

View file

@ -207,7 +207,10 @@ export default Vue.extend({
return this.onEdit !== undefined || this.onSelected !== undefined || this.bookReady || this.canReadPages || this.actionMenu
},
computedItem(): Item<BookDto | SeriesDto | CollectionDto | ReadListDto> {
return createItem(this.item)
let item = this.item
if ('libraryId' in this.item && this.$store.getters.getLibraryById((this.item as any).libraryId).unavailable)
item = {...item, deleted: true}
return createItem(item)
},
disableHover(): boolean {
return !this.overlay

View file

@ -59,4 +59,5 @@ export interface LibraryDto {
convertToCbz: boolean,
emptyTrashAfterScan: boolean,
seriesCover: SeriesCoverDto,
unavailable: boolean,
}

View file

@ -136,7 +136,7 @@
</template>{{ $t('browse_book.outdated_tooltip') }}</v-tooltip>
</v-col>
<v-col :class="'py-1 ' + ($vuetify.rtl ? 'pl-0' : 'pr-0')" cols="auto" v-if="book.deleted">
<v-col :class="'py-1 ' + ($vuetify.rtl ? 'pl-0' : 'pr-0')" cols="auto" v-if="unavailable">
<v-chip label small color="error">
{{ $t('common.unavailable') }}
</v-chip>
@ -418,11 +418,14 @@ export default Vue.extend({
isAdmin(): boolean {
return this.$store.getters.meAdmin
},
unavailable(): boolean {
return this.book.deleted || this.$store.getters.getLibraryById(this.book.libraryId).unavailable
},
canRead(): boolean {
return this.book.media.status === 'READY' && this.$store.getters.mePageStreaming && !this.book.deleted
return this.book.media.status === 'READY' && this.$store.getters.mePageStreaming && !this.unavailable
},
canDownload(): boolean {
return this.$store.getters.meFileDownload && !this.book.deleted
return this.$store.getters.meFileDownload && !this.unavailable
},
thumbnailUrl(): string {
return bookThumbnailUrl(this.bookId)

View file

@ -139,7 +139,7 @@
{{ $t(`enums.reading_direction.${series.metadata.readingDirection}`) }}
</v-chip>
</v-col>
<v-col :class="'py-1 ' + ($vuetify.rtl ? 'pl-0' : 'pr-0')" cols="auto" v-if="series.deleted">
<v-col :class="'py-1 ' + ($vuetify.rtl ? 'pl-0' : 'pr-0')" cols="auto" v-if="unavailable">
<v-chip label small color="error">
{{ $t('common.unavailable') }}
</v-chip>
@ -527,8 +527,11 @@ export default Vue.extend({
isAdmin(): boolean {
return this.$store.getters.meAdmin
},
unavailable(): boolean {
return this.series.deleted || this.$store.getters.getLibraryById(this.series.libraryId).unavailable
},
canDownload(): boolean {
return this.$store.getters.meFileDownload && !this.series.deleted
return this.$store.getters.meFileDownload && !this.unavailable
},
fileUrl(): string {
return seriesFileUrl(this.series.id)

View file

@ -85,6 +85,10 @@
</v-list-item-icon>
<v-list-item-content>
<v-list-item-title>{{ l.name }}</v-list-item-title>
<v-list-item-subtitle
v-if="l.unavailable"
class="error--text caption"
>{{ $t('common.unavailable') }}</v-list-item-subtitle>
</v-list-item-content>
<v-list-item-action v-if="isAdmin">
<library-actions-menu :library="l"/>