mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-08-04 18:24:46 +02:00
Fix icon size issue, clean up reader interface, extract metadata from comics #113
This commit is contained in:
parent
03e39640be
commit
e3425acd75
15 changed files with 524 additions and 485 deletions
|
@ -1,5 +1,9 @@
|
|||
export default function ({ $axios, store }) {
|
||||
$axios.onRequest(config => {
|
||||
if (!config.url) {
|
||||
console.error('Axios request invalid config', config)
|
||||
return
|
||||
}
|
||||
if (config.url.startsWith('http:') || config.url.startsWith('https:')) {
|
||||
return
|
||||
}
|
||||
|
|
|
@ -127,6 +127,19 @@ Vue.prototype.$sanitizeFilename = (input, replacement = '') => {
|
|||
return sanitized
|
||||
}
|
||||
|
||||
|
||||
function xmlToJson(xml) {
|
||||
const json = {};
|
||||
for (const res of xml.matchAll(/(?:<(\w*)(?:\s[^>]*)*>)((?:(?!<\1).)*)(?:<\/\1>)|<(\w*)(?:\s*)*\/>/gm)) {
|
||||
const key = res[1] || res[3];
|
||||
const value = res[2] && xmlToJson(res[2]);
|
||||
json[key] = ((value && Object.keys(value).length) ? value : res[2]) || null;
|
||||
|
||||
}
|
||||
return json;
|
||||
}
|
||||
Vue.prototype.$xmlToJson = xmlToJson
|
||||
|
||||
const encode = (text) => encodeURIComponent(Buffer.from(text).toString('base64'))
|
||||
Vue.prototype.$encode = encode
|
||||
const decode = (text) => Buffer.from(decodeURIComponent(text), 'base64').toString()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue