Skip to content

Commit

Permalink
Update:Remove unused missing/invalid audiobook parts logic and keys
Browse files Browse the repository at this point in the history
  • Loading branch information
advplyr committed Mar 21, 2024
1 parent 8d75302 commit ff5226f
Show file tree
Hide file tree
Showing 33 changed files with 19 additions and 190 deletions.
20 changes: 2 additions & 18 deletions client/components/cards/LazyBookCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,7 @@ export default {
},
showError() {
if (this.recentEpisode) return false // Dont show podcast error on episode card
return this.numInvalidAudioFiles || this.numMissingParts || this.isMissing || this.isInvalid
return this.isMissing || this.isInvalid
},
libraryItemIdStreaming() {
return this.store.getters['getLibraryItemIdStreaming']
Expand Down Expand Up @@ -388,29 +388,13 @@ export default {
isInvalid() {
return this._libraryItem.isInvalid
},
numMissingParts() {
if (this.isPodcast) return 0
return this.media.numMissingParts
},
numInvalidAudioFiles() {
if (this.isPodcast) return 0
return this.media.numInvalidAudioFiles
},
errorText() {
if (this.isMissing) return 'Item directory is missing!'
else if (this.isInvalid) {
if (this.isPodcast) return 'Podcast has no episodes'
return 'Item has no audio tracks & ebook'
}
let txt = ''
if (this.numMissingParts) {
txt += `${this.numMissingParts} missing parts.`
}
if (this.numInvalidAudioFiles) {
if (txt) txt += ' '
txt += `${this.numInvalidAudioFiles} invalid audio files.`
}
return txt || 'Unknown Error'
return 'Unknown Error'
},
overlayWrapperClasslist() {
const classes = []
Expand Down
84 changes: 0 additions & 84 deletions client/components/widgets/AudiobookData.vue

This file was deleted.

2 changes: 1 addition & 1 deletion client/pages/audiobook/_id/chapters.vue
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ export default {
return this.media.audioFiles || []
},
audioTracks() {
return this.audioFiles.filter((af) => !af.exclude && !af.invalid)
return this.audioFiles.filter((af) => !af.exclude)
},
selectedChapterId() {
return this.selectedChapter ? this.selectedChapter.id : null
Expand Down
3 changes: 0 additions & 3 deletions client/pages/audiobook/_id/edit.vue
Original file line number Diff line number Diff line change
Expand Up @@ -137,9 +137,6 @@ export default {
})
return count
},
missingParts() {
return this.media.missingParts || []
},
libraryItemId() {
return this.libraryItem.id
},
Expand Down
2 changes: 1 addition & 1 deletion client/pages/audiobook/_id/manage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ export default {
return this.media.metadata || {}
},
audioFiles() {
return (this.media.audioFiles || []).filter((af) => !af.exclude && !af.invalid)
return (this.media.audioFiles || []).filter((af) => !af.exclude)
},
isSingleM4b() {
return this.audioFiles.length === 1 && this.audioFiles[0].metadata.ext.toLowerCase() === '.m4b'
Expand Down
18 changes: 7 additions & 11 deletions client/pages/item/_id/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -131,15 +131,9 @@
</button>
</div>

<div v-if="invalidAudioFiles.length" class="bg-error border-red-800 shadow-md p-4">
<p class="text-sm mb-2">Invalid audio files</p>

<p v-for="audioFile in invalidAudioFiles" :key="audioFile.id" class="text-xs pl-2">- {{ audioFile.metadata.filename }} ({{ audioFile.error }})</p>
</div>

<tables-chapters-table v-if="chapters.length" :library-item="libraryItem" class="mt-6" />

<widgets-audiobook-data v-if="tracks.length" :library-item-id="libraryItemId" :is-file="isFile" :media="media" />
<tables-tracks-table v-if="tracks.length" :title="$strings.LabelStatsAudioTracks" :tracks="tracksWithAudioFile" :is-file="isFile" :library-item-id="libraryItemId" class="mt-6" />

<tables-podcast-lazy-episodes-table v-if="isPodcast" :library-item="libraryItem" />

Expand Down Expand Up @@ -239,10 +233,6 @@ export default {
isAbridged() {
return !!this.mediaMetadata.abridged
},
invalidAudioFiles() {
if (!this.isBook) return []
return this.libraryItem.media.audioFiles.filter((af) => af.invalid)
},
showPlayButton() {
if (this.isMissing || this.isInvalid) return false
if (this.isMusic) return !!this.audioFile
Expand Down Expand Up @@ -275,6 +265,12 @@ export default {
tracks() {
return this.media.tracks || []
},
tracksWithAudioFile() {
return this.tracks.map((track) => {
track.audioFile = this.media.audioFiles?.find((af) => af.metadata.path === track.metadata.path)
return track
})
},
podcastEpisodes() {
return this.media.episodes || []
},
Expand Down
2 changes: 0 additions & 2 deletions client/strings/cs.json
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,6 @@
"LabelIntervalEvery6Hours": "Každých 6 hodin",
"LabelIntervalEveryDay": "Každý den",
"LabelIntervalEveryHour": "Každou hodinu",
"LabelInvalidParts": "Neplatné části",
"LabelInvert": "Invertovat",
"LabelItem": "Položka",
"LabelLanguage": "Jazyk",
Expand Down Expand Up @@ -357,7 +356,6 @@
"LabelMinute": "Minuta",
"LabelMissing": "Chybějící",
"LabelMissingEbook": "Has no ebook",
"LabelMissingParts": "Chybějící díly",
"LabelMissingSupplementaryEbook": "Has no supplementary ebook",
"LabelMobileRedirectURIs": "Allowed Mobile Redirect URIs",
"LabelMobileRedirectURIsDescription": "This is a whitelist of valid redirect URIs for mobile apps. The default one is <code>audiobookshelf://oauth</code>, which you can remove or supplement with additional URIs for third-party app integration. Using an asterisk (<code>*</code>) as the sole entry permits any URI.",
Expand Down
2 changes: 0 additions & 2 deletions client/strings/da.json
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,6 @@
"LabelIntervalEvery6Hours": "Hver 6. time",
"LabelIntervalEveryDay": "Hver dag",
"LabelIntervalEveryHour": "Hver time",
"LabelInvalidParts": "Ugyldige dele",
"LabelInvert": "Inverter",
"LabelItem": "Element",
"LabelLanguage": "Sprog",
Expand Down Expand Up @@ -357,7 +356,6 @@
"LabelMinute": "Minut",
"LabelMissing": "Mangler",
"LabelMissingEbook": "Has no ebook",
"LabelMissingParts": "Manglende dele",
"LabelMissingSupplementaryEbook": "Has no supplementary ebook",
"LabelMobileRedirectURIs": "Allowed Mobile Redirect URIs",
"LabelMobileRedirectURIsDescription": "This is a whitelist of valid redirect URIs for mobile apps. The default one is <code>audiobookshelf://oauth</code>, which you can remove or supplement with additional URIs for third-party app integration. Using an asterisk (<code>*</code>) as the sole entry permits any URI.",
Expand Down
2 changes: 0 additions & 2 deletions client/strings/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,6 @@
"LabelIntervalEvery6Hours": "Alle 6 Stunden",
"LabelIntervalEveryDay": "Jeden Tag",
"LabelIntervalEveryHour": "Jede Stunde",
"LabelInvalidParts": "Ungültige Teile",
"LabelInvert": "Umkehren",
"LabelItem": "Medium",
"LabelLanguage": "Sprache",
Expand Down Expand Up @@ -357,7 +356,6 @@
"LabelMinute": "Minute",
"LabelMissing": "Fehlend",
"LabelMissingEbook": "E-Book fehlt",
"LabelMissingParts": "Fehlende Teile",
"LabelMissingSupplementaryEbook": "Ergänzendes E-Book fehlt",
"LabelMobileRedirectURIs": "Erlaubte Weiterleitungs-URIs für die mobile App",
"LabelMobileRedirectURIsDescription": "Dies ist eine Whitelist gültiger Umleitungs-URIs für mobile Apps. Der Standardwert ist <code>audiobookshelf://oauth</code>, den du entfernen oder durch zusätzliche URIs für die Integration von Drittanbieter-Apps ergänzen kannst. Die Verwendung eines Sternchens (<code>*</code>) als alleiniger Eintrag erlaubt jede URI.",
Expand Down
2 changes: 0 additions & 2 deletions client/strings/en-us.json
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,6 @@
"LabelIntervalEvery6Hours": "Every 6 hours",
"LabelIntervalEveryDay": "Every day",
"LabelIntervalEveryHour": "Every hour",
"LabelInvalidParts": "Invalid Parts",
"LabelInvert": "Invert",
"LabelItem": "Item",
"LabelLanguage": "Language",
Expand Down Expand Up @@ -357,7 +356,6 @@
"LabelMinute": "Minute",
"LabelMissing": "Missing",
"LabelMissingEbook": "Has no ebook",
"LabelMissingParts": "Missing Parts",
"LabelMissingSupplementaryEbook": "Has no supplementary ebook",
"LabelMobileRedirectURIs": "Allowed Mobile Redirect URIs",
"LabelMobileRedirectURIsDescription": "This is a whitelist of valid redirect URIs for mobile apps. The default one is <code>audiobookshelf://oauth</code>, which you can remove or supplement with additional URIs for third-party app integration. Using an asterisk (<code>*</code>) as the sole entry permits any URI.",
Expand Down
2 changes: 0 additions & 2 deletions client/strings/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,6 @@
"LabelIntervalEvery6Hours": "Cada 6 Horas",
"LabelIntervalEveryDay": "Cada Día",
"LabelIntervalEveryHour": "Cada Hora",
"LabelInvalidParts": "Partes Inválidas",
"LabelInvert": "Invertir",
"LabelItem": "Elemento",
"LabelLanguage": "Lenguaje",
Expand Down Expand Up @@ -357,7 +356,6 @@
"LabelMinute": "Minuto",
"LabelMissing": "Ausente",
"LabelMissingEbook": "Has no ebook",
"LabelMissingParts": "Partes Ausentes",
"LabelMissingSupplementaryEbook": "Has no supplementary ebook",
"LabelMobileRedirectURIs": "URIs de redirección a móviles permitidos",
"LabelMobileRedirectURIsDescription": "Esta es una lista de URIs válidos para redireccionamiento de apps móviles. La URI por defecto es <code>audiobookshelf://oauth</code>, la cual puedes remover or corroborar con URIs adicionales para la integración con apps de terceros. Utilizando un asterisco (<code>*</code>) como el único punto de entrada permite cualquier URI.",
Expand Down
2 changes: 0 additions & 2 deletions client/strings/et.json
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,6 @@
"LabelIntervalEvery6Hours": "Iga 6 tunni tagant",
"LabelIntervalEveryDay": "Iga päev",
"LabelIntervalEveryHour": "Iga tunni tagant",
"LabelInvalidParts": "Vigased osad",
"LabelInvert": "Pööra ümber",
"LabelItem": "Kirje",
"LabelLanguage": "Keel",
Expand Down Expand Up @@ -357,7 +356,6 @@
"LabelMinute": "Minut",
"LabelMissing": "Puudub",
"LabelMissingEbook": "Has no ebook",
"LabelMissingParts": "Puuduvad osad",
"LabelMissingSupplementaryEbook": "Has no supplementary ebook",
"LabelMobileRedirectURIs": "Lubatud mobiilile suunamise URI-d",
"LabelMobileRedirectURIsDescription": "See on mobiilirakenduste jaoks kehtivate suunamise URI-de lubatud nimekiri. Vaikimisi on selleks <code>audiobookshelf://oauth</code>, mida saate eemaldada või täiendada täiendavate URI-dega kolmanda osapoole rakenduste integreerimiseks. Tärni (<code>*</code>) ainukese kirjena kasutamine võimaldab mis tahes URI-d.",
Expand Down
2 changes: 0 additions & 2 deletions client/strings/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,6 @@
"LabelIntervalEvery6Hours": "Toutes les 6 heures",
"LabelIntervalEveryDay": "Tous les jours",
"LabelIntervalEveryHour": "Toutes les heures",
"LabelInvalidParts": "Parties invalides",
"LabelInvert": "Inverser",
"LabelItem": "Article",
"LabelLanguage": "Langue",
Expand Down Expand Up @@ -357,7 +356,6 @@
"LabelMinute": "Minute",
"LabelMissing": "Manquant",
"LabelMissingEbook": "Has no ebook",
"LabelMissingParts": "Parties manquantes",
"LabelMissingSupplementaryEbook": "Has no supplementary ebook",
"LabelMobileRedirectURIs": "URI de redirection mobile autorisés",
"LabelMobileRedirectURIsDescription": "Il s'agit d'une liste blanche d’URI de redirection valides pour les applications mobiles. Celui par défaut est <code>audiobookshelf://oauth</code>, que vous pouvez supprimer ou compléter avec des URIs supplémentaires pour l'intégration d'applications tierces. L’utilisation d’un astérisque (<code>*</code>) comme seule entrée autorise n’importe quel URI.",
Expand Down
2 changes: 0 additions & 2 deletions client/strings/gu.json
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,6 @@
"LabelIntervalEvery6Hours": "Every 6 hours",
"LabelIntervalEveryDay": "Every day",
"LabelIntervalEveryHour": "Every hour",
"LabelInvalidParts": "Invalid Parts",
"LabelInvert": "Invert",
"LabelItem": "Item",
"LabelLanguage": "Language",
Expand Down Expand Up @@ -357,7 +356,6 @@
"LabelMinute": "Minute",
"LabelMissing": "Missing",
"LabelMissingEbook": "Has no ebook",
"LabelMissingParts": "Missing Parts",
"LabelMissingSupplementaryEbook": "Has no supplementary ebook",
"LabelMobileRedirectURIs": "Allowed Mobile Redirect URIs",
"LabelMobileRedirectURIsDescription": "This is a whitelist of valid redirect URIs for mobile apps. The default one is <code>audiobookshelf://oauth</code>, which you can remove or supplement with additional URIs for third-party app integration. Using an asterisk (<code>*</code>) as the sole entry permits any URI.",
Expand Down
2 changes: 0 additions & 2 deletions client/strings/he.json
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,6 @@
"LabelIntervalEvery6Hours": "כל 6 שעות",
"LabelIntervalEveryDay": "כל יום",
"LabelIntervalEveryHour": "כל שעה",
"LabelInvalidParts": "חלקים לא תקינים",
"LabelInvert": "הפוך",
"LabelItem": "פריט",
"LabelLanguage": "שפה",
Expand Down Expand Up @@ -357,7 +356,6 @@
"LabelMinute": "דקה",
"LabelMissing": "חסר",
"LabelMissingEbook": "אין ספר אלקטרוני",
"LabelMissingParts": "חלקים חסרים",
"LabelMissingSupplementaryEbook": "אין ספר אלקטרוני נלווה",
"LabelMobileRedirectURIs": "כתובות משדר ניידות מורשות",
"LabelMobileRedirectURIsDescription": "זהו רשימה לבניה של כתובות ה-URI הנתמכות להפניות עבור אפליקציות ניידות. הברירת מחדל היא <code>audiobookshelf://oauth</code>, שניתן להסיר או להוסיף לה כתובות נוספות לאינטגרציה עם אפליקציות צד שלישי. שימוש בכוכבית (<code>*</code>) כקלט בודד מאפשר כל URI.",
Expand Down
2 changes: 0 additions & 2 deletions client/strings/hi.json
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,6 @@
"LabelIntervalEvery6Hours": "Every 6 hours",
"LabelIntervalEveryDay": "Every day",
"LabelIntervalEveryHour": "Every hour",
"LabelInvalidParts": "Invalid Parts",
"LabelInvert": "Invert",
"LabelItem": "Item",
"LabelLanguage": "Language",
Expand Down Expand Up @@ -357,7 +356,6 @@
"LabelMinute": "Minute",
"LabelMissing": "Missing",
"LabelMissingEbook": "Has no ebook",
"LabelMissingParts": "Missing Parts",
"LabelMissingSupplementaryEbook": "Has no supplementary ebook",
"LabelMobileRedirectURIs": "Allowed Mobile Redirect URIs",
"LabelMobileRedirectURIsDescription": "This is a whitelist of valid redirect URIs for mobile apps. The default one is <code>audiobookshelf://oauth</code>, which you can remove or supplement with additional URIs for third-party app integration. Using an asterisk (<code>*</code>) as the sole entry permits any URI.",
Expand Down
2 changes: 0 additions & 2 deletions client/strings/hr.json
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,6 @@
"LabelIntervalEvery6Hours": "Every 6 hours",
"LabelIntervalEveryDay": "Every day",
"LabelIntervalEveryHour": "Every hour",
"LabelInvalidParts": "Nevaljajuči dijelovi",
"LabelInvert": "Invert",
"LabelItem": "Stavka",
"LabelLanguage": "Jezik",
Expand Down Expand Up @@ -357,7 +356,6 @@
"LabelMinute": "Minuta",
"LabelMissing": "Nedostaje",
"LabelMissingEbook": "Has no ebook",
"LabelMissingParts": "Nedostajali dijelovi",
"LabelMissingSupplementaryEbook": "Has no supplementary ebook",
"LabelMobileRedirectURIs": "Allowed Mobile Redirect URIs",
"LabelMobileRedirectURIsDescription": "This is a whitelist of valid redirect URIs for mobile apps. The default one is <code>audiobookshelf://oauth</code>, which you can remove or supplement with additional URIs for third-party app integration. Using an asterisk (<code>*</code>) as the sole entry permits any URI.",
Expand Down
2 changes: 0 additions & 2 deletions client/strings/hu.json
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,6 @@
"LabelIntervalEvery6Hours": "Minden 6 órában",
"LabelIntervalEveryDay": "Minden nap",
"LabelIntervalEveryHour": "Minden órában",
"LabelInvalidParts": "Érvénytelen részek",
"LabelInvert": "Megfordítás",
"LabelItem": "Elem",
"LabelLanguage": "Nyelv",
Expand Down Expand Up @@ -357,7 +356,6 @@
"LabelMinute": "Perc",
"LabelMissing": "Hiányzó",
"LabelMissingEbook": "Has no ebook",
"LabelMissingParts": "Hiányzó részek",
"LabelMissingSupplementaryEbook": "Has no supplementary ebook",
"LabelMobileRedirectURIs": "Engedélyezett mobil átirányítási URI-k",
"LabelMobileRedirectURIsDescription": "Ez egy fehérlista az érvényes mobilalkalmazás-átirányítási URI-k számára. Az alapértelmezett <code>audiobookshelf://oauth</code>, amely eltávolítható vagy kiegészíthető további URI-kkal harmadik féltől származó alkalmazásintegráció érdekében. Ha az egyetlen bejegyzés egy csillag (<code>*</code>), akkor bármely URI engedélyezett.",
Expand Down
Loading

0 comments on commit ff5226f

Please sign in to comment.