move collection id of movies into configurations

This commit is contained in:
Sammy 2023-06-12 20:31:52 +02:00
parent c0369fcb49
commit f3669ec34f
2 changed files with 4 additions and 2 deletions

View File

@ -24,6 +24,7 @@ export interface Config {
watcher_role: string watcher_role: string
jf_admin_role: string jf_admin_role: string
announcement_channel_id: string announcement_channel_id: string
jf_collection_id: string
} }
} }
export const config: Config = { export const config: Config = {
@ -56,6 +57,7 @@ export const config: Config = {
workaround_token: process.env.TOKEN ?? "", workaround_token: process.env.TOKEN ?? "",
watcher_role: process.env.WATCHER_ROLE ?? "", watcher_role: process.env.WATCHER_ROLE ?? "",
jf_admin_role: process.env.ADMIN_ROLE ?? "", jf_admin_role: process.env.ADMIN_ROLE ?? "",
announcement_channel_id: process.env.CHANNEL_ID ?? "" announcement_channel_id: process.env.CHANNEL_ID ?? "",
jf_collection_id: process.env.JELLYFIN_COLLECTION_ID ?? ""
} }
} }

View File

@ -236,7 +236,7 @@ export class JellyfinHandler {
const searchParams: GetItemsRequest = { const searchParams: GetItemsRequest = {
userId: liloJfUser?.id, userId: liloJfUser?.id,
parentId: "f137a2dd21bbc1b99aa5c0f6bf02a805" // collection ID for all movies parentId: this.config.bot.jf_collection_id // collection ID for all movies
} }
const movies = (await (this.moviesApi.getItems(searchParams))).items?.filter(item => !item.isFolder) const movies = (await (this.moviesApi.getItems(searchParams))).items?.filter(item => !item.isFolder)
// logger.debug(JSON.stringify(movies, null, 2), { guildId: guildId, requestId }) // logger.debug(JSON.stringify(movies, null, 2), { guildId: guildId, requestId })