mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-01-03 00:06:46 +01:00
Merge branch 'master' into addDownloadQueue
This commit is contained in:
commit
cfb3ce0c60
@ -64,12 +64,22 @@
|
|||||||
|
|
||||||
<div class="flex-grow hidden sm:inline-block" />
|
<div class="flex-grow hidden sm:inline-block" />
|
||||||
|
|
||||||
|
<!-- collapse series checkbox -->
|
||||||
<ui-checkbox v-if="isLibraryPage && isBookLibrary && !isBatchSelecting" v-model="settings.collapseSeries" :label="$strings.LabelCollapseSeries" checkbox-bg="bg" check-color="white" small class="mr-2" @input="updateCollapseSeries" />
|
<ui-checkbox v-if="isLibraryPage && isBookLibrary && !isBatchSelecting" v-model="settings.collapseSeries" :label="$strings.LabelCollapseSeries" checkbox-bg="bg" check-color="white" small class="mr-2" @input="updateCollapseSeries" />
|
||||||
|
|
||||||
|
<!-- library filter select -->
|
||||||
<controls-library-filter-select v-if="isLibraryPage && !isBatchSelecting" v-model="settings.filterBy" class="w-36 sm:w-44 md:w-48 h-7.5 ml-1 sm:ml-4" @change="updateFilter" />
|
<controls-library-filter-select v-if="isLibraryPage && !isBatchSelecting" v-model="settings.filterBy" class="w-36 sm:w-44 md:w-48 h-7.5 ml-1 sm:ml-4" @change="updateFilter" />
|
||||||
|
|
||||||
|
<!-- library sort select -->
|
||||||
<controls-library-sort-select v-if="isLibraryPage && !isBatchSelecting" v-model="settings.orderBy" :descending.sync="settings.orderDesc" class="w-36 sm:w-44 md:w-48 h-7.5 ml-1 sm:ml-4" @change="updateOrder" />
|
<controls-library-sort-select v-if="isLibraryPage && !isBatchSelecting" v-model="settings.orderBy" :descending.sync="settings.orderDesc" class="w-36 sm:w-44 md:w-48 h-7.5 ml-1 sm:ml-4" @change="updateOrder" />
|
||||||
|
|
||||||
|
<!-- series filter select -->
|
||||||
<controls-library-filter-select v-if="isSeriesPage && !isBatchSelecting" v-model="settings.seriesFilterBy" is-series class="w-36 sm:w-44 md:w-48 h-7.5 ml-1 sm:ml-4" @change="updateSeriesFilter" />
|
<controls-library-filter-select v-if="isSeriesPage && !isBatchSelecting" v-model="settings.seriesFilterBy" is-series class="w-36 sm:w-44 md:w-48 h-7.5 ml-1 sm:ml-4" @change="updateSeriesFilter" />
|
||||||
|
|
||||||
|
<!-- series sort select -->
|
||||||
<controls-sort-select v-if="isSeriesPage && !isBatchSelecting" v-model="settings.seriesSortBy" :descending.sync="settings.seriesSortDesc" :items="seriesSortItems" class="w-36 sm:w-44 md:w-48 h-7.5 ml-1 sm:ml-4" @change="updateSeriesSort" />
|
<controls-sort-select v-if="isSeriesPage && !isBatchSelecting" v-model="settings.seriesSortBy" :descending.sync="settings.seriesSortDesc" :items="seriesSortItems" class="w-36 sm:w-44 md:w-48 h-7.5 ml-1 sm:ml-4" @change="updateSeriesSort" />
|
||||||
|
|
||||||
|
<!-- issues page remove all button -->
|
||||||
<ui-btn v-if="isIssuesFilter && userCanDelete && !isBatchSelecting" :loading="processingIssues" color="error" small class="ml-4" @click="removeAllIssues">{{ $strings.ButtonRemoveAll }} {{ numShowing }} {{ entityName }}</ui-btn>
|
<ui-btn v-if="isIssuesFilter && userCanDelete && !isBatchSelecting" :loading="processingIssues" color="error" small class="ml-4" @click="removeAllIssues">{{ $strings.ButtonRemoveAll }} {{ numShowing }} {{ entityName }}</ui-btn>
|
||||||
</template>
|
</template>
|
||||||
<!-- search page -->
|
<!-- search page -->
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<ui-tooltip v-if="alreadyInLibrary" :text="$strings.LabelAlreadyInYourLibrary" direction="top">
|
<ui-tooltip v-if="alreadyInLibrary" :text="$strings.LabelAlreadyInYourLibrary" direction="top">
|
||||||
<span class="material-icons ml-1" style="font-size: 0.8rem">check_circle</span>
|
<span class="material-icons ml-1 text-success" style="font-size: 0.8rem">check_circle</span>
|
||||||
</ui-tooltip>
|
</ui-tooltip>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
@ -155,6 +155,7 @@ export default {
|
|||||||
let podcast = this.existentPodcasts.find((p) => p.itunesId === result.id || p.title === result.title.toLowerCase())
|
let podcast = this.existentPodcasts.find((p) => p.itunesId === result.id || p.title === result.title.toLowerCase())
|
||||||
if (podcast) {
|
if (podcast) {
|
||||||
result.alreadyInLibrary = true
|
result.alreadyInLibrary = true
|
||||||
|
result.existentId = podcast.id
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
this.results = results
|
this.results = results
|
||||||
@ -163,12 +164,16 @@ export default {
|
|||||||
},
|
},
|
||||||
async selectPodcast(podcast) {
|
async selectPodcast(podcast) {
|
||||||
console.log('Selected podcast', podcast)
|
console.log('Selected podcast', podcast)
|
||||||
|
if(podcast.existentId){
|
||||||
|
this.$router.push(`/item/${podcast.existentId}`)
|
||||||
|
return
|
||||||
|
}
|
||||||
if (!podcast.feedUrl) {
|
if (!podcast.feedUrl) {
|
||||||
this.$toast.error('Invalid podcast - no feed')
|
this.$toast.error('Invalid podcast - no feed')
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
this.processing = true
|
this.processing = true
|
||||||
var payload = await this.$axios.$post(`/api/podcasts/feed`, { rssFeed: podcast.feedUrl }).catch((error) => {
|
var payload = await this.$axios.$post(`/api/podcasts/feed`, {rssFeed: podcast.feedUrl}).catch((error) => {
|
||||||
console.error('Failed to get feed', error)
|
console.error('Failed to get feed', error)
|
||||||
this.$toast.error('Failed to get podcast feed')
|
this.$toast.error('Failed to get podcast feed')
|
||||||
return null
|
return null
|
||||||
@ -191,7 +196,8 @@ export default {
|
|||||||
this.existentPodcasts = podcasts.results.map((p) => {
|
this.existentPodcasts = podcasts.results.map((p) => {
|
||||||
return {
|
return {
|
||||||
title: p.media.metadata.title.toLowerCase(),
|
title: p.media.metadata.title.toLowerCase(),
|
||||||
itunesId: p.media.metadata.itunesId
|
itunesId: p.media.metadata.itunesId,
|
||||||
|
id: p.id
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
this.processing = false
|
this.processing = false
|
||||||
|
@ -94,8 +94,8 @@ class FeedMeta {
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
{ 'itunes:explicit': !!this.explicit },
|
{ 'itunes:explicit': !!this.explicit },
|
||||||
{ 'itunes:block': !!this.preventIndexing },
|
{ 'itunes:block': this.preventIndexing?"Yes":"No" },
|
||||||
{ 'googleplay:block': !!this.preventIndexing }
|
{ 'googleplay:block': this.preventIndexing?"yes":"no" }
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
const sanitizeHtml = require('../libs/sanitizeHtml')
|
const sanitizeHtml = require('../libs/sanitizeHtml')
|
||||||
const {entities} = require("./htmlEntities");
|
const { entities } = require("./htmlEntities");
|
||||||
|
|
||||||
function sanitize(html) {
|
function sanitize(html) {
|
||||||
const sanitizerOptions = {
|
const sanitizerOptions = {
|
||||||
allowedTags: [
|
allowedTags: [
|
||||||
'p', 'ol', 'ul', 'li', 'a', 'strong', 'em', 'del'
|
'p', 'ol', 'ul', 'li', 'a', 'strong', 'em', 'del', 'br'
|
||||||
],
|
],
|
||||||
disallowedTagsMode: 'discard',
|
disallowedTagsMode: 'discard',
|
||||||
allowedAttributes: {
|
allowedAttributes: {
|
||||||
|
@ -95,17 +95,20 @@ module.exports = {
|
|||||||
checkSeriesProgressFilter(series, filterBy, user) {
|
checkSeriesProgressFilter(series, filterBy, user) {
|
||||||
const filter = this.decode(filterBy.split('.')[1])
|
const filter = this.decode(filterBy.split('.')[1])
|
||||||
|
|
||||||
var numBooksStartedOrFinished = 0
|
let someBookHasProgress = false
|
||||||
|
let someBookIsUnfinished = false
|
||||||
for (const libraryItem of series.books) {
|
for (const libraryItem of series.books) {
|
||||||
const itemProgress = user.getMediaProgress(libraryItem.id)
|
const itemProgress = user.getMediaProgress(libraryItem.id)
|
||||||
if (filter === 'Finished' && (!itemProgress || !itemProgress.isFinished)) return false
|
if (!itemProgress || !itemProgress.isFinished) someBookIsUnfinished = true
|
||||||
if (filter === 'Not Started' && itemProgress) return false
|
if (itemProgress && itemProgress.progress > 0) someBookHasProgress = true
|
||||||
if (itemProgress) numBooksStartedOrFinished++
|
|
||||||
|
if (filter === 'finished' && (!itemProgress || !itemProgress.isFinished)) return false
|
||||||
|
if (filter === 'not-started' && itemProgress) return false
|
||||||
}
|
}
|
||||||
|
|
||||||
if (numBooksStartedOrFinished === series.books.length) { // Completely finished series
|
if (!someBookIsUnfinished && filter === 'not-finished') { // Completely finished series
|
||||||
if (filter === 'Not Finished') return false
|
return false
|
||||||
} else if (numBooksStartedOrFinished === 0 && filter === 'In Progress') { // Series not started
|
} else if (!someBookHasProgress && filter === 'in-progress') { // Series not started
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
return true
|
return true
|
||||||
|
Loading…
Reference in New Issue
Block a user