mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-06-24 17:59:06 +02:00
Add:Podcast iTunes search api and iTunes provider
This commit is contained in:
parent
2a4cbd48b8
commit
43f48b65f8
7 changed files with 81 additions and 14 deletions
|
@ -15,8 +15,9 @@ const CollectionController = require('./controllers/CollectionController')
|
|||
const MeController = require('./controllers/MeController')
|
||||
const BackupController = require('./controllers/BackupController')
|
||||
|
||||
const BookFinder = require('./BookFinder')
|
||||
const AuthorFinder = require('./AuthorFinder')
|
||||
const BookFinder = require('./finders/BookFinder')
|
||||
const AuthorFinder = require('./finders/AuthorFinder')
|
||||
const PodcastFinder = require('./finders/PodcastFinder')
|
||||
const FileSystemController = require('./controllers/FileSystemController')
|
||||
|
||||
class ApiController {
|
||||
|
@ -36,6 +37,7 @@ class ApiController {
|
|||
|
||||
this.bookFinder = new BookFinder()
|
||||
this.authorFinder = new AuthorFinder()
|
||||
this.podcastFinder = new PodcastFinder()
|
||||
|
||||
this.router = express()
|
||||
this.init()
|
||||
|
@ -131,6 +133,7 @@ class ApiController {
|
|||
//
|
||||
this.router.get('/search/covers', this.findCovers.bind(this))
|
||||
this.router.get('/search/books', this.findBooks.bind(this))
|
||||
this.router.get('/search/podcast', this.findPodcasts.bind(this))
|
||||
|
||||
//
|
||||
// File System Routes
|
||||
|
@ -181,6 +184,12 @@ class ApiController {
|
|||
res.json(result)
|
||||
}
|
||||
|
||||
async findPodcasts(req, res) {
|
||||
var term = req.query.term
|
||||
var results = await this.podcastFinder.search(term)
|
||||
res.json(results)
|
||||
}
|
||||
|
||||
authorize(req, res) {
|
||||
if (!req.user) {
|
||||
Logger.error('Invalid user in authorize')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue