mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2026-04-30 10:59:42 +00:00
Compare commits
No commits in common. "32da0f12242602ae18b858eaf8a4faa48cffb7a9" and "0107cb4782536ea159c4f65960eb4ff89c5f9366" have entirely different histories.
32da0f1224
...
0107cb4782
5 changed files with 6 additions and 39 deletions
|
|
@ -101,8 +101,7 @@
|
||||||
<!-- Podcast Episode # -->
|
<!-- Podcast Episode # -->
|
||||||
<div cy-id="podcastEpisodeNumber" v-if="recentEpisodeNumber !== null && !isHovering && !isSelectionMode && !processing" class="absolute rounded-lg bg-black/90 box-shadow-md z-10" :style="{ top: 0.375 + 'em', right: 0.375 + 'em', padding: `${0.1}em ${0.25}em` }">
|
<div cy-id="podcastEpisodeNumber" v-if="recentEpisodeNumber !== null && !isHovering && !isSelectionMode && !processing" class="absolute rounded-lg bg-black/90 box-shadow-md z-10" :style="{ top: 0.375 + 'em', right: 0.375 + 'em', padding: `${0.1}em ${0.25}em` }">
|
||||||
<p :style="{ fontSize: 0.8 + 'em' }">
|
<p :style="{ fontSize: 0.8 + 'em' }">
|
||||||
Episode
|
Episode<span v-if="recentEpisodeNumber"> #{{ recentEpisodeNumber }}</span>
|
||||||
<span v-if="recentEpisodeNumber">#{{ recentEpisodeNumber }}</span>
|
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
@ -201,9 +200,6 @@ export default {
|
||||||
dateFormat() {
|
dateFormat() {
|
||||||
return this.store.getters['getServerSetting']('dateFormat')
|
return this.store.getters['getServerSetting']('dateFormat')
|
||||||
},
|
},
|
||||||
timeFormat() {
|
|
||||||
return this.store.getters['getServerSetting']('timeFormat')
|
|
||||||
},
|
|
||||||
_libraryItem() {
|
_libraryItem() {
|
||||||
return this.libraryItem || {}
|
return this.libraryItem || {}
|
||||||
},
|
},
|
||||||
|
|
@ -349,10 +345,6 @@ export default {
|
||||||
if (this.mediaMetadata.publishedYear) return this.$getString('LabelPublishedDate', [this.mediaMetadata.publishedYear])
|
if (this.mediaMetadata.publishedYear) return this.$getString('LabelPublishedDate', [this.mediaMetadata.publishedYear])
|
||||||
return '\u00A0'
|
return '\u00A0'
|
||||||
}
|
}
|
||||||
if (this.orderBy === 'progress') {
|
|
||||||
if (!this.userProgressLastUpdated) return '\u00A0'
|
|
||||||
return this.$getString('LabelLastProgressDate', [this.$formatDatetime(this.userProgressLastUpdated, this.dateFormat, this.timeFormat)])
|
|
||||||
}
|
|
||||||
return null
|
return null
|
||||||
},
|
},
|
||||||
episodeProgress() {
|
episodeProgress() {
|
||||||
|
|
@ -385,10 +377,6 @@ export default {
|
||||||
let progressPercent = this.itemIsFinished ? 1 : this.booksInSeries ? this.seriesProgressPercent : this.useEBookProgress ? this.userProgress?.ebookProgress || 0 : this.userProgress?.progress || 0
|
let progressPercent = this.itemIsFinished ? 1 : this.booksInSeries ? this.seriesProgressPercent : this.useEBookProgress ? this.userProgress?.ebookProgress || 0 : this.userProgress?.progress || 0
|
||||||
return Math.max(Math.min(1, progressPercent), 0)
|
return Math.max(Math.min(1, progressPercent), 0)
|
||||||
},
|
},
|
||||||
userProgressLastUpdated() {
|
|
||||||
if (!this.userProgress) return null
|
|
||||||
return this.userProgress.lastUpdate
|
|
||||||
},
|
|
||||||
itemIsFinished() {
|
itemIsFinished() {
|
||||||
if (this.booksInSeries) return this.seriesIsFinished
|
if (this.booksInSeries) return this.seriesIsFinished
|
||||||
return this.userProgress ? !!this.userProgress.isFinished : false
|
return this.userProgress ? !!this.userProgress.isFinished : false
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@
|
||||||
</span>
|
</span>
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
<ul v-show="showMenu" class="librarySortMenu absolute z-10 mt-1 w-full bg-bg border border-black-200 shadow-lg max-h-96 rounded-md py-1 ring-1 ring-black/5 overflow-auto focus:outline-hidden text-sm" role="menu">
|
<ul v-show="showMenu" class="absolute z-10 mt-1 w-full bg-bg border border-black-200 shadow-lg max-h-96 rounded-md py-1 ring-1 ring-black/5 overflow-auto focus:outline-hidden text-sm" role="menu">
|
||||||
<template v-for="item in selectItems">
|
<template v-for="item in selectItems">
|
||||||
<li :key="item.value" class="select-none relative py-2 pr-9 cursor-pointer hover:bg-white/5" :class="item.value === selected ? 'bg-white/5 text-yellow-400' : 'text-gray-200 hover:text-white'" role="menuitem" @click="clickedOption(item.value)">
|
<li :key="item.value" class="select-none relative py-2 pr-9 cursor-pointer hover:bg-white/5" :class="item.value === selected ? 'bg-white/5 text-yellow-400' : 'text-gray-200 hover:text-white'" role="menuitem" @click="clickedOption(item.value)">
|
||||||
<div class="flex items-center">
|
<div class="flex items-center">
|
||||||
|
|
@ -130,10 +130,6 @@ export default {
|
||||||
text: this.$strings.LabelFileModified,
|
text: this.$strings.LabelFileModified,
|
||||||
value: 'mtimeMs'
|
value: 'mtimeMs'
|
||||||
},
|
},
|
||||||
{
|
|
||||||
text: this.$strings.LabelLibrarySortByProgress,
|
|
||||||
value: 'progress'
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
text: this.$strings.LabelRandomly,
|
text: this.$strings.LabelRandomly,
|
||||||
value: 'random'
|
value: 'random'
|
||||||
|
|
@ -195,9 +191,3 @@ export default {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped>
|
|
||||||
.librarySortMenu {
|
|
||||||
max-height: calc(100vh - 125px);
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
|
|
@ -92,7 +92,7 @@ export const actions = {
|
||||||
if (state.settings.orderBy == 'media.duration') {
|
if (state.settings.orderBy == 'media.duration') {
|
||||||
settingsUpdate.orderBy = 'media.numTracks'
|
settingsUpdate.orderBy = 'media.numTracks'
|
||||||
}
|
}
|
||||||
if (state.settings.orderBy == 'media.metadata.publishedYear' || state.settings.orderBy == 'progress') {
|
if (state.settings.orderBy == 'media.metadata.publishedYear') {
|
||||||
settingsUpdate.orderBy = 'media.metadata.title'
|
settingsUpdate.orderBy = 'media.metadata.title'
|
||||||
}
|
}
|
||||||
const invalidFilters = ['series', 'authors', 'narrators', 'publishers', 'publishedDecades', 'languages', 'progress', 'issues', 'ebooks', 'abridged']
|
const invalidFilters = ['series', 'authors', 'narrators', 'publishers', 'publishedDecades', 'languages', 'progress', 'issues', 'ebooks', 'abridged']
|
||||||
|
|
|
||||||
|
|
@ -418,7 +418,6 @@
|
||||||
"LabelLanguages": "Languages",
|
"LabelLanguages": "Languages",
|
||||||
"LabelLastBookAdded": "Last Book Added",
|
"LabelLastBookAdded": "Last Book Added",
|
||||||
"LabelLastBookUpdated": "Last Book Updated",
|
"LabelLastBookUpdated": "Last Book Updated",
|
||||||
"LabelLastProgressDate": "Last progress: {0}",
|
|
||||||
"LabelLastSeen": "Last Seen",
|
"LabelLastSeen": "Last Seen",
|
||||||
"LabelLastTime": "Last Time",
|
"LabelLastTime": "Last Time",
|
||||||
"LabelLastUpdate": "Last Update",
|
"LabelLastUpdate": "Last Update",
|
||||||
|
|
@ -431,7 +430,6 @@
|
||||||
"LabelLibraryFilterSublistEmpty": "No {0}",
|
"LabelLibraryFilterSublistEmpty": "No {0}",
|
||||||
"LabelLibraryItem": "Library Item",
|
"LabelLibraryItem": "Library Item",
|
||||||
"LabelLibraryName": "Library Name",
|
"LabelLibraryName": "Library Name",
|
||||||
"LabelLibrarySortByProgress": "Progress Updated",
|
|
||||||
"LabelLimit": "Limit",
|
"LabelLimit": "Limit",
|
||||||
"LabelLineSpacing": "Line spacing",
|
"LabelLineSpacing": "Line spacing",
|
||||||
"LabelListenAgain": "Listen Again",
|
"LabelListenAgain": "Listen Again",
|
||||||
|
|
|
||||||
|
|
@ -399,6 +399,9 @@ module.exports = {
|
||||||
if (filterGroup !== 'series' && sortBy === 'sequence') {
|
if (filterGroup !== 'series' && sortBy === 'sequence') {
|
||||||
sortBy = 'media.metadata.title'
|
sortBy = 'media.metadata.title'
|
||||||
}
|
}
|
||||||
|
if (filterGroup !== 'progress' && sortBy === 'progress') {
|
||||||
|
sortBy = 'media.metadata.title'
|
||||||
|
}
|
||||||
const includeRSSFeed = include.includes('rssfeed')
|
const includeRSSFeed = include.includes('rssfeed')
|
||||||
const includeMediaItemShare = !!user?.isAdminOrUp && include.includes('share')
|
const includeMediaItemShare = !!user?.isAdminOrUp && include.includes('share')
|
||||||
|
|
||||||
|
|
@ -529,18 +532,6 @@ module.exports = {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// When sorting by progress but not filtering by progress, include media progresses
|
|
||||||
if (filterGroup !== 'progress' && sortBy === 'progress') {
|
|
||||||
bookIncludes.push({
|
|
||||||
model: Database.mediaProgressModel,
|
|
||||||
attributes: ['id', 'isFinished', 'currentTime', 'ebookProgress', 'updatedAt'],
|
|
||||||
where: {
|
|
||||||
userId: user.id
|
|
||||||
},
|
|
||||||
required: false
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
let { mediaWhere, replacements } = this.getMediaGroupQuery(filterGroup, filterValue)
|
let { mediaWhere, replacements } = this.getMediaGroupQuery(filterGroup, filterValue)
|
||||||
let bookWhere = Array.isArray(mediaWhere) ? mediaWhere : [mediaWhere]
|
let bookWhere = Array.isArray(mediaWhere) ? mediaWhere : [mediaWhere]
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue