mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-07-19 18:34:25 +02:00
Start of new data model
This commit is contained in:
parent
2b7f53b0a7
commit
65793f7109
18 changed files with 672 additions and 8 deletions
44
server/objects/metadata/PodcastMetadata.js
Normal file
44
server/objects/metadata/PodcastMetadata.js
Normal file
|
@ -0,0 +1,44 @@
|
|||
class PodcastMetadata {
|
||||
constructor(metadata) {
|
||||
this.title = null
|
||||
this.artist = null
|
||||
this.description = null
|
||||
this.releaseDate = null
|
||||
this.genres = []
|
||||
this.feedUrl = null
|
||||
this.itunesPageUrl = null
|
||||
this.itunesId = null
|
||||
this.itunesArtistId = null
|
||||
|
||||
if (metadata) {
|
||||
this.construct(metadata)
|
||||
}
|
||||
}
|
||||
|
||||
construct(metadata) {
|
||||
this.title = metadata.title
|
||||
this.artist = metadata.artist
|
||||
this.description = metadata.description
|
||||
this.releaseDate = metadata.releaseDate
|
||||
this.genres = [...metadata.genres]
|
||||
this.feedUrl = metadata.feedUrl
|
||||
this.itunesPageUrl = metadata.itunesPageUrl
|
||||
this.itunesId = metadata.itunesId
|
||||
this.itunesArtistId = metadata.itunesArtistId
|
||||
}
|
||||
|
||||
toJSON() {
|
||||
return {
|
||||
title: this.title,
|
||||
artist: this.artist,
|
||||
description: this.description,
|
||||
releaseDate: this.releaseDate,
|
||||
genres: [...this.genres],
|
||||
feedUrl: this.feedUrl,
|
||||
itunesPageUrl: this.itunesPageUrl,
|
||||
itunesId: this.itunesId,
|
||||
itunesArtistId: this.itunesArtistId,
|
||||
}
|
||||
}
|
||||
}
|
||||
module.exports = PodcastMetadata
|
Loading…
Add table
Add a link
Reference in a new issue