mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2026-02-20 13:53:19 +01:00
Add:Persist RSS feeds in db #696, Update:RSS feed data model
This commit is contained in:
47
server/objects/FeedMeta.js
Normal file
47
server/objects/FeedMeta.js
Normal file
@@ -0,0 +1,47 @@
|
||||
class FeedMeta {
|
||||
constructor(meta) {
|
||||
this.title = null
|
||||
this.description = null
|
||||
this.author = null
|
||||
this.imageUrl = null
|
||||
this.feedUrl = null
|
||||
this.link = null
|
||||
|
||||
if (meta) {
|
||||
this.construct(meta)
|
||||
}
|
||||
}
|
||||
|
||||
construct(meta) {
|
||||
this.title = meta.title
|
||||
this.description = meta.description
|
||||
this.author = meta.author
|
||||
this.imageUrl = meta.imageUrl
|
||||
this.feedUrl = meta.feedUrl
|
||||
this.link = meta.link
|
||||
}
|
||||
|
||||
toJSON() {
|
||||
return {
|
||||
title: this.title,
|
||||
description: this.description,
|
||||
author: this.author,
|
||||
imageUrl: this.imageUrl,
|
||||
feedUrl: this.feedUrl,
|
||||
link: this.link
|
||||
}
|
||||
}
|
||||
|
||||
getPodcastMeta() {
|
||||
return {
|
||||
title: this.title,
|
||||
description: this.description,
|
||||
feedUrl: this.feedUrl,
|
||||
siteUrl: this.link,
|
||||
imageUrl: this.imageUrl,
|
||||
author: this.author || 'advplyr',
|
||||
language: 'en'
|
||||
}
|
||||
}
|
||||
}
|
||||
module.exports = FeedMeta
|
||||
Reference in New Issue
Block a user