Add Podcast match tab and find covers

This commit is contained in:
advplyr 2022-04-13 18:13:39 -05:00
parent 4edba20e9e
commit 3f6ed6dbf9
10 changed files with 113 additions and 20 deletions

View file

@ -121,6 +121,7 @@ export default {
}
},
providers() {
if (this.isPodcast) return this.$store.state.scanners.podcastProviders
return this.$store.state.scanners.providers
},
searchTitleLabel() {
@ -137,6 +138,12 @@ export default {
libraryItemId() {
return this.libraryItem ? this.libraryItem.id : null
},
mediaType() {
return this.libraryItem ? this.libraryItem.mediaType : null
},
isPodcast() {
return this.mediaType == 'podcast'
},
media() {
return this.libraryItem ? this.libraryItem.media || {} : {}
},
@ -212,7 +219,8 @@ export default {
this.imageUrl = this.media.coverPath || ''
this.searchTitle = this.mediaMetadata.title || ''
this.searchAuthor = this.mediaMetadata.authorName || ''
this.provider = localStorage.getItem('book-provider') || 'openlibrary'
if (this.isPodcast) this.provider = 'itunes'
else this.provider = localStorage.getItem('book-provider') || 'google'
},
removeCover() {
if (!this.media.coverPath) {
@ -278,6 +286,7 @@ export default {
getSearchQuery() {
var searchQuery = `provider=${this.provider}&title=${this.searchTitle}`
if (this.searchAuthor) searchQuery += `&author=${this.searchAuthor}`
if (this.isPodcast) searchQuery += '&podcast=1'
return searchQuery
},
persistProvider() {