mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2026-06-08 03:32:43 +02:00
Add:Podcast iTunes search api and iTunes provider
This commit is contained in:
+11
-2
@@ -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')
|
||||
|
||||
Reference in New Issue
Block a user