New data model start of PlaybackSessionManager to replace StreamManager, remove podcast & ip npm package

This commit is contained in:
advplyr 2022-03-15 19:28:54 -05:00
parent 68b13ae45f
commit 0af6ad63c1
11 changed files with 109 additions and 116 deletions

View file

@ -1,6 +1,6 @@
const Podcast = require('podcast')
// const Podcast = require('podcast')
const express = require('express')
const ip = require('ip')
// const ip = require('ip')
const Logger = require('./Logger')
// Not functional at the moment - just an idea
@ -29,29 +29,31 @@ class RssFeeds {
}
openFeed(audiobook) {
var ipAddress = ip.address('public', 'ipv4')
var serverAddress = 'http://' + ipAddress + ':' + this.Port
Logger.info('Open RSS Feed', 'Server address', serverAddress)
// Removed Podcast npm package and ip package
return null
// var ipAddress = ip.address('public', 'ipv4')
// var serverAddress = 'http://' + ipAddress + ':' + this.Port
// Logger.info('Open RSS Feed', 'Server address', serverAddress)
var feedId = (Date.now() + Math.floor(Math.random() * 1000)).toString(36)
const feed = new Podcast({
title: audiobook.title,
description: 'AudioBookshelf RSS Feed',
feed_url: `${serverAddress}/feeds/${feedId}`,
image_url: `${serverAddress}/Logo.png`,
author: 'advplyr',
language: 'en'
})
audiobook.tracks.forEach((track) => {
feed.addItem({
title: `Track ${track.index}`,
description: `AudioBookshelf Audiobook Track #${track.index}`,
url: `${serverAddress}/feeds/${feedId}?track=${track.index}`,
author: 'advplyr'
})
})
this.feeds[feedId] = feed
return feed
// var feedId = (Date.now() + Math.floor(Math.random() * 1000)).toString(36)
// const feed = new Podcast({
// title: audiobook.title,
// description: 'AudioBookshelf RSS Feed',
// feed_url: `${serverAddress}/feeds/${feedId}`,
// image_url: `${serverAddress}/Logo.png`,
// author: 'advplyr',
// language: 'en'
// })
// audiobook.tracks.forEach((track) => {
// feed.addItem({
// title: `Track ${track.index}`,
// description: `AudioBookshelf Audiobook Track #${track.index}`,
// url: `${serverAddress}/feeds/${feedId}?track=${track.index}`,
// author: 'advplyr'
// })
// })
// this.feeds[feedId] = feed
// return feed
}
}
module.exports = RssFeeds