forked from advplyr/audiobookshelf
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into ffmpeg-latest
- Loading branch information
Showing
81 changed files
with
2,689 additions
and
766 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
105 changes: 105 additions & 0 deletions
105
client/components/modals/AddCustomMetadataProviderModal.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,105 @@ | ||
<template> | ||
<modals-modal ref="modal" v-model="show" name="custom-metadata-provider" :width="600" :height="'unset'" :processing="processing"> | ||
<template #outer> | ||
<div class="absolute top-0 left-0 p-5 w-2/3 overflow-hidden"> | ||
<p class="text-3xl text-white truncate">Add custom metadata provider</p> | ||
</div> | ||
</template> | ||
<form @submit.prevent="submitForm"> | ||
<div class="px-4 w-full flex items-center text-sm py-6 rounded-lg bg-bg shadow-lg border border-black-300 overflow-y-auto overflow-x-hidden" style="min-height: 400px; max-height: 80vh"> | ||
<div class="w-full p-8"> | ||
<div class="flex mb-2"> | ||
<div class="w-3/4 p-1"> | ||
<ui-text-input-with-label v-model="newName" :label="$strings.LabelName" /> | ||
</div> | ||
<div class="w-1/4 p-1"> | ||
<ui-text-input-with-label value="Book" readonly :label="$strings.LabelMediaType" /> | ||
</div> | ||
</div> | ||
<div class="w-full mb-2 p-1"> | ||
<ui-text-input-with-label v-model="newUrl" label="URL" /> | ||
</div> | ||
<div class="w-full mb-2 p-1"> | ||
<ui-text-input-with-label v-model="newAuthHeaderValue" :label="'Authorization Header Value'" type="password" /> | ||
</div> | ||
<div class="flex px-1 pt-4"> | ||
<div class="flex-grow" /> | ||
<ui-btn color="success" type="submit">{{ $strings.ButtonAdd }}</ui-btn> | ||
</div> | ||
</div> | ||
</div> | ||
</form> | ||
</modals-modal> | ||
</template> | ||
|
||
<script> | ||
export default { | ||
props: { | ||
value: Boolean | ||
}, | ||
data() { | ||
return { | ||
processing: false, | ||
newName: '', | ||
newUrl: '', | ||
newAuthHeaderValue: '' | ||
} | ||
}, | ||
watch: { | ||
show: { | ||
handler(newVal) { | ||
if (newVal) { | ||
this.init() | ||
} | ||
} | ||
} | ||
}, | ||
computed: { | ||
show: { | ||
get() { | ||
return this.value | ||
}, | ||
set(val) { | ||
this.$emit('input', val) | ||
} | ||
} | ||
}, | ||
methods: { | ||
submitForm() { | ||
if (!this.newName || !this.newUrl) { | ||
this.$toast.error('Must add name and url') | ||
return | ||
} | ||
this.processing = true | ||
this.$axios | ||
.$post('/api/custom-metadata-providers', { | ||
name: this.newName, | ||
url: this.newUrl, | ||
mediaType: 'book', // Currently only supporting book mediaType | ||
authHeaderValue: this.newAuthHeaderValue | ||
}) | ||
.then((data) => { | ||
this.$emit('added', data.provider) | ||
this.$toast.success('New provider added') | ||
this.show = false | ||
}) | ||
.catch((error) => { | ||
const errorMsg = error.response?.data || 'Unknown error' | ||
console.error('Failed to add provider', error) | ||
this.$toast.error('Failed to add provider: ' + errorMsg) | ||
}) | ||
.finally(() => { | ||
this.processing = false | ||
}) | ||
}, | ||
init() { | ||
this.processing = false | ||
this.newName = '' | ||
this.newUrl = '' | ||
this.newAuthHeaderValue = '' | ||
} | ||
}, | ||
mounted() {} | ||
} | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.