mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-06-29 04:00:32 +02:00
Add:Persist RSS feeds in db #696, Update:RSS feed data model
This commit is contained in:
parent
881baa818d
commit
fbbceaa642
9 changed files with 366 additions and 130 deletions
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
|
Loading…
Add table
Add a link
Reference in a new issue