2021-06-24 15:18:54 +02:00
|
|
|
import { CONFIG } from '../../initializers/constants'
|
|
|
|
import { DBPlaylist, IndexablePlaylist } from '../../types/playlist.model'
|
2021-07-28 13:25:39 +02:00
|
|
|
import { buildPlaylistsMapping, formatPlaylistForDB } from '../elastic-search/elastic-search-playlists'
|
2021-06-24 15:18:54 +02:00
|
|
|
import { AbstractIndexer } from './shared'
|
|
|
|
|
|
|
|
export class PlaylistIndexer extends AbstractIndexer <IndexablePlaylist, DBPlaylist> {
|
|
|
|
|
|
|
|
constructor () {
|
|
|
|
super(CONFIG.ELASTIC_SEARCH.INDEXES.PLAYLISTS, formatPlaylistForDB)
|
|
|
|
}
|
|
|
|
|
|
|
|
async indexSpecificElement (host: string, uuid: string) {
|
|
|
|
// We don't need to index a specific element yet, since we have all playlist information in the list endpoint
|
|
|
|
throw new Error('Not implemented')
|
|
|
|
}
|
2021-07-28 13:25:39 +02:00
|
|
|
|
|
|
|
buildMapping () {
|
|
|
|
return buildPlaylistsMapping()
|
|
|
|
}
|
2021-06-24 15:18:54 +02:00
|
|
|
}
|