Add podcast add modal

This commit is contained in:
advplyr 2022-03-18 19:16:54 -05:00
parent a9b9e23f46
commit deadc63dbb
9 changed files with 212 additions and 18 deletions

View file

@ -1,11 +1,12 @@
class PodcastMetadata {
constructor(metadata) {
this.title = null
this.artist = null
this.author = null
this.description = null
this.releaseDate = null
this.genres = []
this.feedUrl = null
this.feedImageUrl = null
this.itunesPageUrl = null
this.itunesId = null
this.itunesArtistId = null
@ -18,11 +19,12 @@ class PodcastMetadata {
construct(metadata) {
this.title = metadata.title
this.artist = metadata.artist
this.author = metadata.author
this.description = metadata.description
this.releaseDate = metadata.releaseDate
this.genres = [...metadata.genres]
this.feedUrl = metadata.feedUrl
this.feedImageUrl = metadata.feedImageUrl
this.itunesPageUrl = metadata.itunesPageUrl
this.itunesId = metadata.itunesId
this.itunesArtistId = metadata.itunesArtistId
@ -32,11 +34,12 @@ class PodcastMetadata {
toJSON() {
return {
title: this.title,
artist: this.artist,
author: this.author,
description: this.description,
releaseDate: this.releaseDate,
genres: [...this.genres],
feedUrl: this.feedUrl,
feedImageUrl: this.feedImageUrl,
itunesPageUrl: this.itunesPageUrl,
itunesId: this.itunesId,
itunesArtistId: this.itunesArtistId,
@ -53,7 +56,7 @@ class PodcastMetadata {
}
searchQuery(query) { // Returns key if match is found
var keysToCheck = ['title', 'artist', 'itunesId', 'itunesArtistId']
var keysToCheck = ['title', 'author', 'itunesId', 'itunesArtistId']
for (var key of keysToCheck) {
if (this[key] && String(this[key]).toLowerCase().includes(query)) {
return {