mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2026-07-07 01:41:35 +00:00
Compare commits
2 commits
320e4dfb47
...
2f6de71a3a
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2f6de71a3a | ||
|
|
deb121c523 |
2 changed files with 15 additions and 1 deletions
|
|
@ -400,7 +400,9 @@ export default {
|
||||||
this.$toast.warning(this.$strings.ToastTitleRequired)
|
this.$toast.warning(this.$strings.ToastTitleRequired)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
this.persistProvider()
|
if (!this.isPodcast) {
|
||||||
|
this.persistProvider()
|
||||||
|
}
|
||||||
this.runSearch()
|
this.runSearch()
|
||||||
},
|
},
|
||||||
async runSearch() {
|
async runSearch() {
|
||||||
|
|
|
||||||
|
|
@ -82,6 +82,13 @@ class Podcast extends Model {
|
||||||
const genres = Array.isArray(payload.metadata.genres) && payload.metadata.genres.every((g) => typeof g === 'string' && g.length) ? payload.metadata.genres : []
|
const genres = Array.isArray(payload.metadata.genres) && payload.metadata.genres.every((g) => typeof g === 'string' && g.length) ? payload.metadata.genres : []
|
||||||
const tags = Array.isArray(payload.tags) && payload.tags.every((t) => typeof t === 'string' && t.length) ? payload.tags : []
|
const tags = Array.isArray(payload.tags) && payload.tags.every((t) => typeof t === 'string' && t.length) ? payload.tags : []
|
||||||
|
|
||||||
|
const stringKeys = ['title', 'author', 'releaseDate', 'feedUrl', 'imageUrl', 'description', 'itunesPageUrl', 'itunesId', 'itunesArtistId', 'language', 'type']
|
||||||
|
stringKeys.forEach((key) => {
|
||||||
|
if (typeof payload.metadata[key] === 'number') {
|
||||||
|
payload.metadata[key] = String(payload.metadata[key])
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
return this.create(
|
return this.create(
|
||||||
{
|
{
|
||||||
title,
|
title,
|
||||||
|
|
@ -205,6 +212,11 @@ class Podcast extends Model {
|
||||||
if (payload.metadata) {
|
if (payload.metadata) {
|
||||||
const stringKeys = ['title', 'author', 'releaseDate', 'feedUrl', 'imageUrl', 'description', 'itunesPageUrl', 'itunesId', 'itunesArtistId', 'language', 'type']
|
const stringKeys = ['title', 'author', 'releaseDate', 'feedUrl', 'imageUrl', 'description', 'itunesPageUrl', 'itunesId', 'itunesArtistId', 'language', 'type']
|
||||||
stringKeys.forEach((key) => {
|
stringKeys.forEach((key) => {
|
||||||
|
// Convert numbers to strings
|
||||||
|
if (typeof payload.metadata[key] === 'number') {
|
||||||
|
payload.metadata[key] = String(payload.metadata[key])
|
||||||
|
}
|
||||||
|
|
||||||
let newKey = key
|
let newKey = key
|
||||||
if (key === 'type') {
|
if (key === 'type') {
|
||||||
newKey = 'podcastType'
|
newKey = 'podcastType'
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue