mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2024-12-28 17:49:06 +01:00
Open rss feed metadataDetails optional
This commit is contained in:
parent
5bdbc75522
commit
caacf461ab
@ -18,7 +18,7 @@ class RSSFeedController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Check request body options exist
|
// Check request body options exist
|
||||||
if (!options.serverAddress || !options.slug || options.metadataDetails == null) {
|
if (!options.serverAddress || !options.slug) {
|
||||||
Logger.error(`[RSSFeedController] Invalid request body to open RSS feed`)
|
Logger.error(`[RSSFeedController] Invalid request body to open RSS feed`)
|
||||||
return res.status(400).send('Invalid request body')
|
return res.status(400).send('Invalid request body')
|
||||||
}
|
}
|
||||||
@ -49,7 +49,7 @@ class RSSFeedController {
|
|||||||
if (!collection) return res.sendStatus(404)
|
if (!collection) return res.sendStatus(404)
|
||||||
|
|
||||||
// Check request body options exist
|
// Check request body options exist
|
||||||
if (!options.serverAddress || !options.slug || options.metadataDetails == null) {
|
if (!options.serverAddress || !options.slug) {
|
||||||
Logger.error(`[RSSFeedController] Invalid request body to open RSS feed`)
|
Logger.error(`[RSSFeedController] Invalid request body to open RSS feed`)
|
||||||
return res.status(400).send('Invalid request body')
|
return res.status(400).send('Invalid request body')
|
||||||
}
|
}
|
||||||
@ -83,7 +83,7 @@ class RSSFeedController {
|
|||||||
if (!series) return res.sendStatus(404)
|
if (!series) return res.sendStatus(404)
|
||||||
|
|
||||||
// Check request body options exist
|
// Check request body options exist
|
||||||
if (!options.serverAddress || !options.slug || options.metadataDetails == null) {
|
if (!options.serverAddress || !options.slug) {
|
||||||
Logger.error(`[RSSFeedController] Invalid request body to open RSS feed`)
|
Logger.error(`[RSSFeedController] Invalid request body to open RSS feed`)
|
||||||
return res.status(400).send('Invalid request body')
|
return res.status(400).send('Invalid request body')
|
||||||
}
|
}
|
||||||
|
@ -188,9 +188,9 @@ class RssFeedManager {
|
|||||||
async openFeedForItem(user, libraryItem, options) {
|
async openFeedForItem(user, libraryItem, options) {
|
||||||
const serverAddress = options.serverAddress
|
const serverAddress = options.serverAddress
|
||||||
const slug = options.slug
|
const slug = options.slug
|
||||||
const preventIndexing = options.metadataDetails.preventIndexing
|
const preventIndexing = options.metadataDetails?.preventIndexing ?? true
|
||||||
const ownerName = options.metadataDetails.ownerName
|
const ownerName = options.metadataDetails?.ownerName
|
||||||
const ownerEmail = options.metadataDetails.ownerEmail
|
const ownerEmail = options.metadataDetails?.ownerEmail
|
||||||
|
|
||||||
const feed = new Feed()
|
const feed = new Feed()
|
||||||
feed.setFromItem(user.id, slug, libraryItem, serverAddress, preventIndexing, ownerName, ownerEmail)
|
feed.setFromItem(user.id, slug, libraryItem, serverAddress, preventIndexing, ownerName, ownerEmail)
|
||||||
@ -205,9 +205,9 @@ class RssFeedManager {
|
|||||||
async openFeedForCollection(user, collectionExpanded, options) {
|
async openFeedForCollection(user, collectionExpanded, options) {
|
||||||
const serverAddress = options.serverAddress
|
const serverAddress = options.serverAddress
|
||||||
const slug = options.slug
|
const slug = options.slug
|
||||||
const preventIndexing = options.metadataDetails.preventIndexing
|
const preventIndexing = options.metadataDetails?.preventIndexing ?? true
|
||||||
const ownerName = options.metadataDetails.ownerName
|
const ownerName = options.metadataDetails?.ownerName
|
||||||
const ownerEmail = options.metadataDetails.ownerEmail
|
const ownerEmail = options.metadataDetails?.ownerEmail
|
||||||
|
|
||||||
const feed = new Feed()
|
const feed = new Feed()
|
||||||
feed.setFromCollection(user.id, slug, collectionExpanded, serverAddress, preventIndexing, ownerName, ownerEmail)
|
feed.setFromCollection(user.id, slug, collectionExpanded, serverAddress, preventIndexing, ownerName, ownerEmail)
|
||||||
@ -222,9 +222,9 @@ class RssFeedManager {
|
|||||||
async openFeedForSeries(user, seriesExpanded, options) {
|
async openFeedForSeries(user, seriesExpanded, options) {
|
||||||
const serverAddress = options.serverAddress
|
const serverAddress = options.serverAddress
|
||||||
const slug = options.slug
|
const slug = options.slug
|
||||||
const preventIndexing = options.metadataDetails.preventIndexing
|
const preventIndexing = options.metadataDetails?.preventIndexing ?? true
|
||||||
const ownerName = options.metadataDetails.ownerName
|
const ownerName = options.metadataDetails?.ownerName
|
||||||
const ownerEmail = options.metadataDetails.ownerEmail
|
const ownerEmail = options.metadataDetails?.ownerEmail
|
||||||
|
|
||||||
const feed = new Feed()
|
const feed = new Feed()
|
||||||
feed.setFromSeries(user.id, slug, seriesExpanded, serverAddress, preventIndexing, ownerName, ownerEmail)
|
feed.setFromSeries(user.id, slug, seriesExpanded, serverAddress, preventIndexing, ownerName, ownerEmail)
|
||||||
|
Loading…
Reference in New Issue
Block a user