Compare commits

..

No commits in common. "be041f93c245a3fd97dbde8f6eabc60e0cae7ed6" and "04fb8fa61d187535545c95d21e1f4548b7d0a2b3" have entirely different histories.

6 changed files with 10 additions and 26 deletions

View file

@ -141,21 +141,10 @@
</div> </div>
</template> </template>
<div class="w-full h-full max-h-full text-sm rounded-lg bg-bg shadow-lg border border-black-300 relative"> <div class="w-full h-full max-h-full text-sm rounded-lg bg-bg shadow-lg border border-black-300 relative">
<div v-if="!chapterData" class="flex flex-col items-center justify-center p-20"> <div v-if="!chapterData" class="flex p-20">
<div class="relative">
<div class="flex items-end space-x-2">
<ui-text-input-with-label v-model.trim="asinInput" label="ASIN" /> <ui-text-input-with-label v-model.trim="asinInput" label="ASIN" />
<ui-dropdown v-model="regionInput" :label="$strings.LabelRegion" small :items="audibleRegions" class="w-32" /> <ui-dropdown v-model="regionInput" :label="$strings.LabelRegion" small :items="audibleRegions" class="w-32 mx-1" />
<ui-btn small color="bg-primary" @click="findChapters">{{ $strings.ButtonSearch }}</ui-btn> <ui-btn small color="bg-primary" class="mt-5" @click="findChapters">{{ $strings.ButtonSearch }}</ui-btn>
</div>
<div class="absolute left-0 mt-1.5 text-error text-s h-5">
<p v-if="asinError">{{ asinError }}</p>
<p v-if="asinError">{{ $strings.MessageAsinCheck }}</p>
</div>
<div class="invisible h-5 mt-1 text-xs"></div>
</div>
</div> </div>
<div v-else class="w-full p-4"> <div v-else class="w-full p-4">
<div class="flex justify-between mb-4"> <div class="flex justify-between mb-4">
@ -260,7 +249,6 @@ export default {
findingChapters: false, findingChapters: false,
showFindChaptersModal: false, showFindChaptersModal: false,
chapterData: null, chapterData: null,
asinError: null,
showSecondInputs: false, showSecondInputs: false,
audibleRegions: ['US', 'CA', 'UK', 'AU', 'FR', 'DE', 'JP', 'IT', 'IN', 'ES'], audibleRegions: ['US', 'CA', 'UK', 'AU', 'FR', 'DE', 'JP', 'IT', 'IN', 'ES'],
hasChanges: false hasChanges: false
@ -558,14 +546,14 @@ export default {
this.findingChapters = true this.findingChapters = true
this.chapterData = null this.chapterData = null
this.asinError = null // used to show warning about audible vs amazon ASIN
this.$axios this.$axios
.$get(`/api/search/chapters?asin=${this.asinInput}&region=${this.regionInput}`) .$get(`/api/search/chapters?asin=${this.asinInput}&region=${this.regionInput}`)
.then((data) => { .then((data) => {
this.findingChapters = false this.findingChapters = false
if (data.error) { if (data.error) {
this.asinError = this.$getString(data.stringKey) this.$toast.error(data.error)
this.showFindChaptersModal = false
} else { } else {
console.log('Chapter data', data) console.log('Chapter data', data)
this.chapterData = data this.chapterData = data

View file

@ -1,6 +1,6 @@
const SupportedFileTypes = { const SupportedFileTypes = {
image: ['png', 'jpg', 'jpeg', 'webp'], image: ['png', 'jpg', 'jpeg', 'webp'],
audio: ['m4b', 'mp3', 'm4a', 'flac', 'opus', 'ogg', 'oga', 'mp4', 'aac', 'wma', 'aiff', 'aif','wav', 'webm', 'webma', 'mka', 'awb', 'caf', 'mpeg', 'mpg'], audio: ['m4b', 'mp3', 'm4a', 'flac', 'opus', 'ogg', 'oga', 'mp4', 'aac', 'wma', 'aiff', 'wav', 'webm', 'webma', 'mka', 'awb', 'caf', 'mpeg', 'mpg'],
ebook: ['epub', 'pdf', 'mobi', 'azw3', 'cbr', 'cbz'], ebook: ['epub', 'pdf', 'mobi', 'azw3', 'cbr', 'cbz'],
info: ['nfo'], info: ['nfo'],
text: ['txt'], text: ['txt'],

View file

@ -705,7 +705,6 @@
"LabelYourProgress": "Your Progress", "LabelYourProgress": "Your Progress",
"MessageAddToPlayerQueue": "Add to player queue", "MessageAddToPlayerQueue": "Add to player queue",
"MessageAppriseDescription": "To use this feature you will need to have an instance of <a href=\"https://github.com/caronc/apprise-api\" target=\"_blank\">Apprise API</a> running or an api that will handle those same requests. <br />The Apprise API Url should be the full URL path to send the notification, e.g., if your API instance is served at <code>http://192.168.1.1:8337</code> then you would put <code>http://192.168.1.1:8337/notify</code>.", "MessageAppriseDescription": "To use this feature you will need to have an instance of <a href=\"https://github.com/caronc/apprise-api\" target=\"_blank\">Apprise API</a> running or an api that will handle those same requests. <br />The Apprise API Url should be the full URL path to send the notification, e.g., if your API instance is served at <code>http://192.168.1.1:8337</code> then you would put <code>http://192.168.1.1:8337/notify</code>.",
"MessageAsinCheck": "Ensure you are using the ASIN from the correct Audible region, not Amazon.",
"MessageBackupsDescription": "Backups include users, user progress, library item details, server settings, and images stored in <code>/metadata/items</code> & <code>/metadata/authors</code>. Backups <strong>do not</strong> include any files stored in your library folders.", "MessageBackupsDescription": "Backups include users, user progress, library item details, server settings, and images stored in <code>/metadata/items</code> & <code>/metadata/authors</code>. Backups <strong>do not</strong> include any files stored in your library folders.",
"MessageBackupsLocationEditNote": "Note: Updating the backup location will not move or modify existing backups", "MessageBackupsLocationEditNote": "Note: Updating the backup location will not move or modify existing backups",
"MessageBackupsLocationNoEditNote": "Note: The backup location is set through an environment variable and cannot be changed here.", "MessageBackupsLocationNoEditNote": "Note: The backup location is set through an environment variable and cannot be changed here.",
@ -724,7 +723,6 @@
"MessageChapterErrorStartGteDuration": "Invalid start time must be less than audiobook duration", "MessageChapterErrorStartGteDuration": "Invalid start time must be less than audiobook duration",
"MessageChapterErrorStartLtPrev": "Invalid start time must be greater than or equal to previous chapter start time", "MessageChapterErrorStartLtPrev": "Invalid start time must be greater than or equal to previous chapter start time",
"MessageChapterStartIsAfter": "Chapter start is after the end of your audiobook", "MessageChapterStartIsAfter": "Chapter start is after the end of your audiobook",
"MessageChaptersNotFound": "Chapters not found",
"MessageCheckingCron": "Checking cron...", "MessageCheckingCron": "Checking cron...",
"MessageConfirmCloseFeed": "Are you sure you want to close this feed?", "MessageConfirmCloseFeed": "Are you sure you want to close this feed?",
"MessageConfirmDeleteBackup": "Are you sure you want to delete backup for {0}?", "MessageConfirmDeleteBackup": "Are you sure you want to delete backup for {0}?",
@ -781,7 +779,6 @@
"MessageForceReScanDescription": "will scan all files again like a fresh scan. Audio file ID3 tags, OPF files, and text files will be scanned as new.", "MessageForceReScanDescription": "will scan all files again like a fresh scan. Audio file ID3 tags, OPF files, and text files will be scanned as new.",
"MessageImportantNotice": "Important Notice!", "MessageImportantNotice": "Important Notice!",
"MessageInsertChapterBelow": "Insert chapter below", "MessageInsertChapterBelow": "Insert chapter below",
"MessageInvalidAsin": "Invalid ASIN",
"MessageItemsSelected": "{0} items selected", "MessageItemsSelected": "{0} items selected",
"MessageItemsUpdated": "{0} items updated", "MessageItemsUpdated": "{0} items updated",
"MessageJoinUsOn": "Join us on", "MessageJoinUsOn": "Join us on",

View file

@ -108,12 +108,12 @@ class SearchController {
async findChapters(req, res) { async findChapters(req, res) {
const asin = req.query.asin const asin = req.query.asin
if (!isValidASIN(asin.toUpperCase())) { if (!isValidASIN(asin.toUpperCase())) {
return res.json({ error: 'Invalid ASIN', stringKey: 'MessageInvalidAsin' }) return res.json({ error: 'Invalid ASIN' })
} }
const region = (req.query.region || 'us').toLowerCase() const region = (req.query.region || 'us').toLowerCase()
const chapterData = await BookFinder.findChapters(asin, region) const chapterData = await BookFinder.findChapters(asin, region)
if (!chapterData) { if (!chapterData) {
return res.json({ error: 'Chapters not found', stringKey: 'MessageChaptersNotFound' }) return res.json({ error: 'Chapters not found' })
} }
res.json(chapterData) res.json(chapterData)
} }

View file

@ -45,7 +45,6 @@ module.exports.AudioMimeType = {
FLAC: 'audio/flac', FLAC: 'audio/flac',
WMA: 'audio/x-ms-wma', WMA: 'audio/x-ms-wma',
AIFF: 'audio/x-aiff', AIFF: 'audio/x-aiff',
AIF: 'audio/x-aiff',
WEBM: 'audio/webm', WEBM: 'audio/webm',
WEBMA: 'audio/webm', WEBMA: 'audio/webm',
MKA: 'audio/x-matroska', MKA: 'audio/x-matroska',

View file

@ -1,6 +1,6 @@
const globals = { const globals = {
SupportedImageTypes: ['png', 'jpg', 'jpeg', 'webp'], SupportedImageTypes: ['png', 'jpg', 'jpeg', 'webp'],
SupportedAudioTypes: ['m4b', 'mp3', 'm4a', 'flac', 'opus', 'ogg', 'oga', 'mp4', 'aac', 'wma', 'aiff', 'aif', 'wav', 'webm', 'webma', 'mka', 'awb', 'caf', 'mpg', 'mpeg'], SupportedAudioTypes: ['m4b', 'mp3', 'm4a', 'flac', 'opus', 'ogg', 'oga', 'mp4', 'aac', 'wma', 'aiff', 'wav', 'webm', 'webma', 'mka', 'awb', 'caf', 'mpg', 'mpeg'],
SupportedEbookTypes: ['epub', 'pdf', 'mobi', 'azw3', 'cbr', 'cbz'], SupportedEbookTypes: ['epub', 'pdf', 'mobi', 'azw3', 'cbr', 'cbz'],
TextFileTypes: ['txt', 'nfo'], TextFileTypes: ['txt', 'nfo'],
MetadataFileTypes: ['opf', 'abs', 'xml', 'json'] MetadataFileTypes: ['opf', 'abs', 'xml', 'json']