feat(ai-query): add AI query API scaffold with all 15 endpoints
This commit is contained in:
1 parent
8641e55362
commit
6b6e95e736
5 files changed
+1095
-286
No files matched your search
@@ -0,0 +1,573 @@
|
||||
const { Op } = require('sequelize');
|
||||
const sequelize = require('../config/database');
|
||||
const Entry = require('../models/Entry');
|
||||
const EntryId = require('../models/EntryId');
|
||||
const EntryRating = require('../models/EntryRating');
|
||||
const EntrySeen = require('../models/EntrySeen');
|
||||
const Episode = require('../models/Episode');
|
||||
const EpisodeSeen = require('../models/EpisodeSeen');
|
||||
const Season = require('../models/Season');
|
||||
const Genre = require('../models/Genre');
|
||||
const Collection = require('../models/Collection');
|
||||
const Credit = require('../models/Credit');
|
||||
const People = require('../models/People');
|
||||
const Network = require('../models/Network');
|
||||
const Media = require('../models/Media');
|
||||
const asyncWrapper = require('../utils/asyncWrapper');
|
||||
|
||||
// ─── Shared Helper ──────────────────────────────────────────────────────────
|
||||
|
||||
function formatEntryBrief(entry) {
|
||||
return {
|
||||
id: entry.id,
|
||||
title: entry.title,
|
||||
is_tvseries: entry.is_tvseries,
|
||||
poster_path: entry.poster_path,
|
||||
banner_path: entry.banner_path,
|
||||
runtime: entry.runtime,
|
||||
release_date: entry.release_date,
|
||||
is_favorite: entry.favorit,
|
||||
is_on_watchlist: entry.watchlist,
|
||||
rating: entry.entryRating || null,
|
||||
genres: entry.genres || []
|
||||
};
|
||||
}
|
||||
|
||||
// ─── Controller ─────────────────────────────────────────────────────────────
|
||||
|
||||
class AiQueryController {
|
||||
|
||||
constructor() {
|
||||
if (!AiQueryController.instance) {
|
||||
AiQueryController.instance = this;
|
||||
}
|
||||
return AiQueryController.instance;
|
||||
}
|
||||
|
||||
// ── Task 2: Recently Watched Movies ──────────────────────────────────────
|
||||
|
||||
getRecentlyWatchedMovies = asyncWrapper(async (req, res) => {
|
||||
const limit = Math.min(parseInt(req.query.limit) || 10, 50);
|
||||
|
||||
const entries = await EntrySeen.findAll({
|
||||
include: [{
|
||||
model: Entry,
|
||||
as: 'entry',
|
||||
include: [
|
||||
{ model: EntryRating, as: 'entryRating', attributes: ['userRating', 'tmdbRating', 'imdbRating', 'rottenTomatoesRating'] },
|
||||
{ model: Genre, as: 'genres', attributes: ['id', 'name'], through: { attributes: [] } }
|
||||
],
|
||||
attributes: ['id', 'title', 'is_tvseries', 'poster_path', 'banner_path', 'runtime', 'release_date', 'favorit', 'watchlist']
|
||||
}],
|
||||
where: {
|
||||
'$entry.is_tvseries$': false,
|
||||
'$entry.hidden$': false
|
||||
},
|
||||
order: [['date_seen', 'DESC'], ['id', 'DESC']],
|
||||
limit,
|
||||
subQuery: false
|
||||
});
|
||||
|
||||
const result = entries.map(es => ({
|
||||
watch_id: es.id,
|
||||
date_watched: es.date_seen,
|
||||
seen_with: es.seen_with,
|
||||
accuracy: es.accuracy,
|
||||
entry: {
|
||||
id: es.entry.id,
|
||||
title: es.entry.title,
|
||||
poster_path: es.entry.poster_path,
|
||||
banner_path: es.entry.banner_path,
|
||||
runtime: es.entry.runtime,
|
||||
release_date: es.entry.release_date,
|
||||
is_favorite: es.entry.favorit,
|
||||
rating: es.entry.entryRating || null,
|
||||
genres: es.entry.genres || []
|
||||
}
|
||||
}));
|
||||
|
||||
res.status(200).json(result);
|
||||
});
|
||||
|
||||
// ── Task 3: Recently Watched Episodes ────────────────────────────────────
|
||||
|
||||
getRecentlyWatchedEpisodes = asyncWrapper(async (req, res) => {
|
||||
const limit = Math.min(parseInt(req.query.limit) || 10, 50);
|
||||
|
||||
const records = await EpisodeSeen.findAll({
|
||||
include: [{
|
||||
model: Episode,
|
||||
as: 'episode',
|
||||
attributes: ['id', 'name', 'episode_number', 'runtime', 'still_path', 'air_date'],
|
||||
include: [{
|
||||
model: Season,
|
||||
as: 'season',
|
||||
attributes: ['id', 'name', 'season_number'],
|
||||
include: [{
|
||||
model: Entry,
|
||||
as: 'entry',
|
||||
attributes: ['id', 'title', 'is_tvseries', 'poster_path', 'banner_path'],
|
||||
where: { hidden: false }
|
||||
}]
|
||||
}]
|
||||
}],
|
||||
order: [['date_seen', 'DESC'], ['id', 'DESC']],
|
||||
limit,
|
||||
subQuery: false
|
||||
});
|
||||
|
||||
const result = records.map(es => ({
|
||||
watch_id: es.id,
|
||||
date_watched: es.date_seen,
|
||||
seen_with: es.seen_with,
|
||||
episode: {
|
||||
id: es.episode.id,
|
||||
name: es.episode.name,
|
||||
episode_number: es.episode.episode_number,
|
||||
runtime: es.episode.runtime,
|
||||
still_path: es.episode.still_path,
|
||||
air_date: es.episode.air_date
|
||||
},
|
||||
season: es.episode.season ? {
|
||||
id: es.episode.season.id,
|
||||
name: es.episode.season.name,
|
||||
season_number: es.episode.season.season_number
|
||||
} : null,
|
||||
series: es.episode.season && es.episode.season.entry ? {
|
||||
id: es.episode.season.entry.id,
|
||||
title: es.episode.season.entry.title,
|
||||
poster_path: es.episode.season.entry.poster_path
|
||||
} : null
|
||||
}));
|
||||
|
||||
res.status(200).json(result);
|
||||
});
|
||||
|
||||
// ── Task 4: Watchlist ────────────────────────────────────────────────────
|
||||
|
||||
getWatchlist = asyncWrapper(async (req, res) => {
|
||||
const entries = await Entry.findAll({
|
||||
where: { watchlist: true, hidden: false },
|
||||
include: [
|
||||
{ model: EntryRating, as: 'entryRating', attributes: ['userRating', 'tmdbRating', 'imdbRating', 'rottenTomatoesRating'] },
|
||||
{ model: Genre, as: 'genres', attributes: ['id', 'name'], through: { attributes: [] } }
|
||||
],
|
||||
order: [['updatedAt', 'DESC']]
|
||||
});
|
||||
|
||||
res.status(200).json(entries.map(formatEntryBrief));
|
||||
});
|
||||
|
||||
// ── Task 5: Favorites ────────────────────────────────────────────────────
|
||||
|
||||
getFavorites = asyncWrapper(async (req, res) => {
|
||||
const entries = await Entry.findAll({
|
||||
where: { favorit: true, hidden: false },
|
||||
include: [
|
||||
{ model: EntryRating, as: 'entryRating', attributes: ['userRating', 'tmdbRating', 'imdbRating', 'rottenTomatoesRating'] },
|
||||
{ model: Genre, as: 'genres', attributes: ['id', 'name'], through: { attributes: [] } }
|
||||
],
|
||||
order: [['updatedAt', 'DESC']]
|
||||
});
|
||||
|
||||
res.status(200).json(entries.map(formatEntryBrief));
|
||||
});
|
||||
|
||||
// ── Task 6: Library Overview ─────────────────────────────────────────────
|
||||
|
||||
getLibraryOverview = asyncWrapper(async (req, res) => {
|
||||
const [movieCount, seriesCount, totalEntries, movieWatchTime, seriesWatchTime,
|
||||
movieSeenCount, episodeSeenCount, genreCount] = await Promise.all([
|
||||
Entry.count({ where: { is_tvseries: false, hidden: false } }),
|
||||
Entry.count({ where: { is_tvseries: true, hidden: false } }),
|
||||
Entry.count({ where: { hidden: false } }),
|
||||
EntrySeen.findOne({
|
||||
include: [{ model: Entry, as: 'entry', attributes: [], where: { hidden: false } }],
|
||||
attributes: [[sequelize.fn('COALESCE', sequelize.fn('SUM', sequelize.col('runtime')), 0), 'totalMinutes']]
|
||||
}),
|
||||
EpisodeSeen.findOne({
|
||||
include: [{ model: Episode, as: 'episode', attributes: [] }],
|
||||
attributes: [[sequelize.fn('COALESCE', sequelize.fn('SUM', sequelize.col('runtime')), 0), 'totalMinutes']]
|
||||
}),
|
||||
EntrySeen.count({ include: [{ model: Entry, as: 'entry', where: { hidden: false }, attributes: [] }] }),
|
||||
EpisodeSeen.count(),
|
||||
Entry.count({
|
||||
distinct: true,
|
||||
include: [{ model: Genre, as: 'genres', attributes: [] }],
|
||||
attributes: []
|
||||
})
|
||||
]);
|
||||
|
||||
res.status(200).json({
|
||||
total_entries: totalEntries,
|
||||
total_movies: movieCount,
|
||||
total_series: seriesCount,
|
||||
movies_watched_count: movieSeenCount,
|
||||
episodes_watched_count: episodeSeenCount,
|
||||
total_genres: genreCount,
|
||||
total_watch_time_minutes: {
|
||||
movies: parseInt(movieWatchTime.dataValues.totalMinutes) || 0,
|
||||
series: parseInt(seriesWatchTime.dataValues.totalMinutes) || 0
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
// ── Task 7: Search Library ───────────────────────────────────────────────
|
||||
|
||||
searchLibrary = asyncWrapper(async (req, res) => {
|
||||
const { q, type, genre, watchlist, favorite } = req.query;
|
||||
const limit = Math.min(parseInt(req.query.limit) || 20, 100);
|
||||
|
||||
const where = { hidden: false };
|
||||
|
||||
if (q) {
|
||||
where.title = { [Op.like]: `%${q}%` };
|
||||
}
|
||||
if (type === 'movie') where.is_tvseries = false;
|
||||
if (type === 'series') where.is_tvseries = true;
|
||||
if (watchlist === 'true') where.watchlist = true;
|
||||
if (favorite === 'true') where.favorit = true;
|
||||
|
||||
const entries = await Entry.findAll({
|
||||
where,
|
||||
include: [
|
||||
{ model: EntryRating, as: 'entryRating', attributes: ['userRating', 'tmdbRating', 'imdbRating', 'rottenTomatoesRating'] },
|
||||
{ model: Genre, as: 'genres', attributes: ['id', 'name'], through: { attributes: [] } }
|
||||
],
|
||||
order: [['title', 'ASC']],
|
||||
limit
|
||||
});
|
||||
|
||||
if (genre) {
|
||||
const filtered = entries.filter(e =>
|
||||
e.genres.some(g => g.name.toLowerCase() === genre.toLowerCase())
|
||||
);
|
||||
return res.status(200).json(filtered.map(formatEntryBrief));
|
||||
}
|
||||
|
||||
res.status(200).json(entries.map(formatEntryBrief));
|
||||
});
|
||||
|
||||
// ── Task 8: Upcoming ─────────────────────────────────────────────────────
|
||||
|
||||
getUpcoming = asyncWrapper(async (req, res) => {
|
||||
const today = new Date();
|
||||
const thirtyDaysLater = new Date(today.getTime() + 30 * 24 * 60 * 60 * 1000);
|
||||
|
||||
const [upcomingMovies, nextEpisodes] = await Promise.all([
|
||||
Entry.findAll({
|
||||
where: {
|
||||
is_tvseries: false,
|
||||
release_date: { [Op.gte]: today },
|
||||
hidden: false,
|
||||
showInCalendar: true
|
||||
},
|
||||
attributes: ['id', 'title', 'release_date', 'poster_path', 'banner_path', 'runtime'],
|
||||
order: [['release_date', 'ASC']],
|
||||
limit: 20
|
||||
}),
|
||||
Episode.findAll({
|
||||
where: {
|
||||
air_date: { [Op.gte]: today, [Op.lte]: thirtyDaysLater }
|
||||
},
|
||||
attributes: ['id', 'name', 'episode_number', 'air_date', 'still_path'],
|
||||
include: [{
|
||||
model: Season,
|
||||
as: 'season',
|
||||
attributes: ['id', 'name', 'season_number', 'entry_id'],
|
||||
include: [{
|
||||
model: Entry,
|
||||
as: 'entry',
|
||||
attributes: ['id', 'title', 'poster_path', 'is_tvseries'],
|
||||
where: { hidden: false, showInCalendar: true }
|
||||
}]
|
||||
}],
|
||||
order: [['air_date', 'ASC']],
|
||||
limit: 20
|
||||
})
|
||||
]);
|
||||
|
||||
res.status(200).json({
|
||||
upcoming_movies: upcomingMovies.map(e => ({
|
||||
id: e.id,
|
||||
title: e.title,
|
||||
release_date: e.release_date,
|
||||
poster_path: e.poster_path,
|
||||
banner_path: e.banner_path,
|
||||
runtime: e.runtime
|
||||
})),
|
||||
upcoming_episodes: nextEpisodes.map(ep => ({
|
||||
id: ep.id,
|
||||
name: ep.name,
|
||||
episode_number: ep.episode_number,
|
||||
air_date: ep.air_date,
|
||||
still_path: ep.still_path,
|
||||
series_title: ep.season?.entry?.title,
|
||||
series_id: ep.season?.entry?.id,
|
||||
season_number: ep.season?.season_number,
|
||||
season_name: ep.season?.name
|
||||
}))
|
||||
});
|
||||
});
|
||||
|
||||
// ── Task 9: Entry Detail ─────────────────────────────────────────────────
|
||||
|
||||
getEntryDetail = asyncWrapper(async (req, res) => {
|
||||
const { id } = req.params;
|
||||
|
||||
const entry = await Entry.findByPk(id, {
|
||||
include: [
|
||||
{ model: EntryId, as: 'entryId', attributes: { exclude: ['id', 'entry_id'] } },
|
||||
{ model: EntryRating, as: 'entryRating', attributes: { exclude: ['id', 'entry_id'] } },
|
||||
{ model: Genre, as: 'genres', attributes: ['id', 'name'], through: { attributes: [] } },
|
||||
{ model: Network, as: 'networks', attributes: ['id', 'name'], through: { attributes: [] } },
|
||||
{ model: Collection, as: 'collections', attributes: ['id', 'name', 'is_user_collection', 'description'], through: { attributes: [] } },
|
||||
{
|
||||
model: Credit, as: 'credits', limit: 20,
|
||||
include: [{ model: People, as: 'person', attributes: ['id', 'name', 'profile_path', 'known_for_department'] }]
|
||||
},
|
||||
{
|
||||
model: Season, as: 'seasons',
|
||||
include: [{
|
||||
model: Episode, as: 'episodes',
|
||||
attributes: ['id', 'name', 'episode_number', 'runtime', 'air_date', 'still_path', 'overview']
|
||||
}]
|
||||
},
|
||||
{ model: Media, as: 'medias', where: { is_selected: true }, required: false }
|
||||
]
|
||||
});
|
||||
|
||||
if (!entry) {
|
||||
return res.status(404).json({ error: 'Entry not found' });
|
||||
}
|
||||
|
||||
// Also get watch history
|
||||
const watchHistory = await EntrySeen.findAll({
|
||||
where: { entry_id: id },
|
||||
order: [['date_seen', 'DESC']],
|
||||
limit: 50
|
||||
});
|
||||
|
||||
const result = entry.toJSON();
|
||||
result.watch_history = watchHistory;
|
||||
|
||||
res.status(200).json(result);
|
||||
});
|
||||
|
||||
// ── Task 10: Genre Breakdown ─────────────────────────────────────────────
|
||||
|
||||
getGenreBreakdown = asyncWrapper(async (req, res) => {
|
||||
const genres = await Genre.findAll({
|
||||
include: [{
|
||||
model: Entry,
|
||||
as: 'entries',
|
||||
attributes: ['id', 'runtime', 'is_tvseries'],
|
||||
through: { attributes: [] },
|
||||
where: { hidden: false }
|
||||
}]
|
||||
});
|
||||
|
||||
const result = genres.map(g => ({
|
||||
id: g.id,
|
||||
name: g.name,
|
||||
entry_count: g.entries.length,
|
||||
movie_count: g.entries.filter(e => !e.is_tvseries).length,
|
||||
series_count: g.entries.filter(e => e.is_tvseries).length
|
||||
})).filter(g => g.entry_count > 0)
|
||||
.sort((a, b) => b.entry_count - a.entry_count);
|
||||
|
||||
res.status(200).json(result);
|
||||
});
|
||||
|
||||
// ── Task 11: All Collections ─────────────────────────────────────────────
|
||||
|
||||
getAllCollections = asyncWrapper(async (req, res) => {
|
||||
const collections = await Collection.findAll({
|
||||
attributes: ['id', 'name', 'description', 'is_user_collection', 'poster_path', 'backdrop_path'],
|
||||
include: [{
|
||||
model: Entry,
|
||||
as: 'entries',
|
||||
attributes: ['id'],
|
||||
through: { attributes: [] },
|
||||
required: false
|
||||
}],
|
||||
order: [['name', 'ASC']]
|
||||
});
|
||||
|
||||
res.status(200).json(collections.map(c => ({
|
||||
id: c.id,
|
||||
name: c.name,
|
||||
description: c.description,
|
||||
is_user_collection: c.is_user_collection,
|
||||
poster_path: c.poster_path,
|
||||
backdrop_path: c.backdrop_path,
|
||||
entry_count: c.entries.length
|
||||
})));
|
||||
});
|
||||
|
||||
// ── Task 12: Collection Detail ───────────────────────────────────────────
|
||||
|
||||
getCollectionDetail = asyncWrapper(async (req, res) => {
|
||||
const { id } = req.params;
|
||||
|
||||
const collection = await Collection.findByPk(id, {
|
||||
include: [{
|
||||
model: Entry,
|
||||
as: 'entries',
|
||||
through: { attributes: ['order'] },
|
||||
include: [
|
||||
{ model: EntryRating, as: 'entryRating', attributes: ['userRating', 'tmdbRating'] },
|
||||
{ model: Genre, as: 'genres', attributes: ['name'], through: { attributes: [] } }
|
||||
]
|
||||
}]
|
||||
});
|
||||
|
||||
if (!collection) {
|
||||
return res.status(404).json({ error: 'Collection not found' });
|
||||
}
|
||||
|
||||
res.status(200).json(collection);
|
||||
});
|
||||
|
||||
// ── Task 13: In-Progress Series ──────────────────────────────────────────
|
||||
|
||||
getInProgressSeries = asyncWrapper(async (req, res) => {
|
||||
const seriesWithSeen = await Entry.findAll({
|
||||
where: { is_tvseries: true, hidden: false },
|
||||
include: [
|
||||
{ model: EpisodeSeen, as: 'episodeSeens', attributes: [], required: true, duplicating: false },
|
||||
{
|
||||
model: Season, as: 'seasons',
|
||||
include: [{
|
||||
model: Episode, as: 'episodes',
|
||||
include: [{ model: EpisodeSeen, as: 'episodeSeens', attributes: ['id'], required: false }]
|
||||
}]
|
||||
},
|
||||
{ model: EntryRating, as: 'entryRating', attributes: ['userRating'] }
|
||||
],
|
||||
distinct: true
|
||||
});
|
||||
|
||||
const inProgress = seriesWithSeen
|
||||
.map(s => {
|
||||
const totalEpisodes = s.seasons?.reduce((sum, season) =>
|
||||
sum + (season.episodes?.length || 0), 0) || 0;
|
||||
const seenEpisodes = s.seasons?.reduce((sum, season) =>
|
||||
sum + (season.episodes?.reduce((es, ep) =>
|
||||
es + ((ep.episodeSeens?.length || 0) > 0 ? 1 : 0), 0) || 0), 0) || 0;
|
||||
|
||||
return {
|
||||
id: s.id,
|
||||
title: s.title,
|
||||
poster_path: s.poster_path,
|
||||
banner_path: s.banner_path,
|
||||
user_rating: s.entryRating?.userRating || null,
|
||||
total_episodes: totalEpisodes,
|
||||
seen_episodes: seenEpisodes,
|
||||
progress_pct: totalEpisodes > 0 ? Math.round((seenEpisodes / totalEpisodes) * 100) : 0,
|
||||
is_complete: totalEpisodes > 0 && seenEpisodes >= totalEpisodes
|
||||
};
|
||||
})
|
||||
.filter(s => !s.is_complete && s.seen_episodes > 0)
|
||||
.sort((a, b) => b.progress_pct - a.progress_pct);
|
||||
|
||||
res.status(200).json(inProgress);
|
||||
});
|
||||
|
||||
// ── Task 14: Watch Time Stats ────────────────────────────────────────────
|
||||
|
||||
getWatchTimeStats = asyncWrapper(async (req, res) => {
|
||||
const year = parseInt(req.query.year) || new Date().getFullYear();
|
||||
|
||||
const [totalMovieMinutes, totalEpisodeMinutes,
|
||||
monthlyMovieMinutes, monthlyEpisodeMinutes] = await Promise.all([
|
||||
EntrySeen.findOne({
|
||||
include: [{ model: Entry, as: 'entry', where: { hidden: false }, attributes: [] }],
|
||||
attributes: [[sequelize.fn('COALESCE', sequelize.fn('SUM', sequelize.col('runtime')), 0), 'total']]
|
||||
}),
|
||||
EpisodeSeen.findOne({
|
||||
include: [{ model: Episode, as: 'episode', attributes: [] }],
|
||||
attributes: [[sequelize.fn('COALESCE', sequelize.fn('SUM', sequelize.col('runtime')), 0), 'total']]
|
||||
}),
|
||||
EntrySeen.findAll({
|
||||
include: [{ model: Entry, as: 'entry', where: { hidden: false }, attributes: [] }],
|
||||
attributes: [
|
||||
[sequelize.fn('MONTH', sequelize.col('date_seen')), 'month'],
|
||||
[sequelize.fn('SUM', sequelize.col('runtime')), 'watchTime']
|
||||
],
|
||||
where: sequelize.where(sequelize.fn('YEAR', sequelize.col('date_seen')), year),
|
||||
group: [sequelize.fn('MONTH', sequelize.col('date_seen'))]
|
||||
}),
|
||||
EpisodeSeen.findAll({
|
||||
include: [{ model: Episode, as: 'episode', attributes: [] }],
|
||||
attributes: [
|
||||
[sequelize.fn('MONTH', sequelize.col('date_seen')), 'month'],
|
||||
[sequelize.fn('SUM', sequelize.col('runtime')), 'watchTime']
|
||||
],
|
||||
where: sequelize.where(sequelize.fn('YEAR', sequelize.col('date_seen')), year),
|
||||
group: [sequelize.fn('MONTH', sequelize.col('date_seen'))]
|
||||
})
|
||||
]);
|
||||
|
||||
const totalMovies = parseInt(totalMovieMinutes.dataValues.total) || 0;
|
||||
const totalEpisodes = parseInt(totalEpisodeMinutes.dataValues.total) || 0;
|
||||
const totalMinutes = totalMovies + totalEpisodes;
|
||||
|
||||
const months = ['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec'];
|
||||
const monthlyMap = {};
|
||||
for (let m = 1; m <= 12; m++) {
|
||||
monthlyMap[m] = { month: months[m - 1], movies: 0, episodes: 0, total: 0 };
|
||||
}
|
||||
monthlyMovieMinutes.forEach(r => {
|
||||
const m = parseInt(r.dataValues.month);
|
||||
monthlyMap[m].movies = parseInt(r.dataValues.watchTime) || 0;
|
||||
});
|
||||
monthlyEpisodeMinutes.forEach(r => {
|
||||
const m = parseInt(r.dataValues.month);
|
||||
monthlyMap[m].episodes = parseInt(r.dataValues.watchTime) || 0;
|
||||
});
|
||||
|
||||
const monthly = Object.values(monthlyMap).map(m => ({
|
||||
...m,
|
||||
total: m.movies + m.episodes
|
||||
}));
|
||||
|
||||
res.status(200).json({
|
||||
year,
|
||||
total_watch_time_minutes: totalMinutes,
|
||||
total_watch_time_hours: Math.round((totalMinutes / 60) * 10) / 10,
|
||||
movies_minutes: totalMovies,
|
||||
episodes_minutes: totalEpisodes,
|
||||
monthly
|
||||
});
|
||||
});
|
||||
|
||||
// ── Task 15: Person Detail ───────────────────────────────────────────────
|
||||
|
||||
getPersonDetail = asyncWrapper(async (req, res) => {
|
||||
const { id } = req.params;
|
||||
|
||||
const person = await People.findByPk(id, {
|
||||
include: [{
|
||||
model: Credit,
|
||||
as: 'roles',
|
||||
include: [{
|
||||
model: Entry,
|
||||
as: 'entry',
|
||||
attributes: ['id', 'title', 'is_tvseries', 'poster_path', 'release_date', 'favorit'],
|
||||
where: { hidden: false },
|
||||
required: false
|
||||
}]
|
||||
}]
|
||||
});
|
||||
|
||||
if (!person) {
|
||||
return res.status(404).json({ error: 'Person not found' });
|
||||
}
|
||||
|
||||
res.status(200).json(person);
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
module.exports = new AiQueryController();
|
||||
Generated
+263
-105
@@ -414,6 +414,18 @@
|
||||
"node": ">= 0.6"
|
||||
}
|
||||
},
|
||||
"node_modules/agent-base": {
|
||||
"version": "6.0.2",
|
||||
"resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz",
|
||||
"integrity": "sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"debug": "4"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 6.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/anymatch": {
|
||||
"version": "3.1.3",
|
||||
"resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.3.tgz",
|
||||
@@ -439,7 +451,8 @@
|
||||
"node_modules/asynckit": {
|
||||
"version": "0.4.0",
|
||||
"resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz",
|
||||
"integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q=="
|
||||
"integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/aws-ssl-profiles": {
|
||||
"version": "1.1.2",
|
||||
@@ -450,13 +463,15 @@
|
||||
}
|
||||
},
|
||||
"node_modules/axios": {
|
||||
"version": "1.7.9",
|
||||
"resolved": "https://registry.npmjs.org/axios/-/axios-1.7.9.tgz",
|
||||
"integrity": "sha512-LhLcE7Hbiryz8oMDdDptSrWowmB4Bl6RCt6sIJKpRB4XtVf0iEgewX3au/pJqm+Py1kCASkb/FFKjxQaLtxJvw==",
|
||||
"version": "1.16.1",
|
||||
"resolved": "https://registry.npmjs.org/axios/-/axios-1.16.1.tgz",
|
||||
"integrity": "sha512-caYkukvroVPO8KrzuJEb50Hm07KwfBZPEC3VeFHTsqWHvKTsy54hjJz9BS/cdaypROE2rH6xvm9mHX4fgWkr3A==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"follow-redirects": "^1.15.6",
|
||||
"form-data": "^4.0.0",
|
||||
"proxy-from-env": "^1.1.0"
|
||||
"follow-redirects": "^1.16.0",
|
||||
"form-data": "^4.0.5",
|
||||
"https-proxy-agent": "^5.0.1",
|
||||
"proxy-from-env": "^2.1.0"
|
||||
}
|
||||
},
|
||||
"node_modules/balanced-match": {
|
||||
@@ -476,22 +491,23 @@
|
||||
}
|
||||
},
|
||||
"node_modules/body-parser": {
|
||||
"version": "1.20.3",
|
||||
"resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.3.tgz",
|
||||
"integrity": "sha512-7rAxByjUMqQ3/bHJy7D6OGXvx/MMc4IqBn/X0fcM1QUcAItpZrBEYhWGem+tzXH90c+G01ypMcYJBO9Y30203g==",
|
||||
"version": "1.20.5",
|
||||
"resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.5.tgz",
|
||||
"integrity": "sha512-3grm+/2tUOvu2cjJkvsIxrv/wVpfXQW4PsQHYm7yk4vfpu7Ekl6nEsYBoJUL6qDwZUx8wUhQ8tR2qz+ad9c9OA==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"bytes": "3.1.2",
|
||||
"bytes": "~3.1.2",
|
||||
"content-type": "~1.0.5",
|
||||
"debug": "2.6.9",
|
||||
"depd": "2.0.0",
|
||||
"destroy": "1.2.0",
|
||||
"http-errors": "2.0.0",
|
||||
"iconv-lite": "0.4.24",
|
||||
"on-finished": "2.4.1",
|
||||
"qs": "6.13.0",
|
||||
"raw-body": "2.5.2",
|
||||
"destroy": "~1.2.0",
|
||||
"http-errors": "~2.0.1",
|
||||
"iconv-lite": "~0.4.24",
|
||||
"on-finished": "~2.4.1",
|
||||
"qs": "~6.15.1",
|
||||
"raw-body": "~2.5.3",
|
||||
"type-is": "~1.6.18",
|
||||
"unpipe": "1.0.0"
|
||||
"unpipe": "~1.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.8",
|
||||
@@ -506,15 +522,45 @@
|
||||
"ms": "2.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/body-parser/node_modules/http-errors": {
|
||||
"version": "2.0.1",
|
||||
"resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.1.tgz",
|
||||
"integrity": "sha512-4FbRdAX+bSdmo4AUFuS0WNiPz8NgFt+r8ThgNWmlrjQjt1Q7ZR9+zTlce2859x4KSXrwIsaeTqDoKQmtP8pLmQ==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"depd": "~2.0.0",
|
||||
"inherits": "~2.0.4",
|
||||
"setprototypeof": "~1.2.0",
|
||||
"statuses": "~2.0.2",
|
||||
"toidentifier": "~1.0.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.8"
|
||||
},
|
||||
"funding": {
|
||||
"type": "opencollective",
|
||||
"url": "https://opencollective.com/express"
|
||||
}
|
||||
},
|
||||
"node_modules/body-parser/node_modules/ms": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz",
|
||||
"integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A=="
|
||||
},
|
||||
"node_modules/body-parser/node_modules/statuses": {
|
||||
"version": "2.0.2",
|
||||
"resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.2.tgz",
|
||||
"integrity": "sha512-DvEy55V3DB7uknRo+4iOGT5fP1slR8wQohVdknigZPMpMstaKJQWhwiYBACJE3Ul2pTnATihhBYnRhZQHGBiRw==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">= 0.8"
|
||||
}
|
||||
},
|
||||
"node_modules/brace-expansion": {
|
||||
"version": "1.1.11",
|
||||
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz",
|
||||
"integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==",
|
||||
"version": "1.1.14",
|
||||
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.14.tgz",
|
||||
"integrity": "sha512-MWPGfDxnyzKU7rNOW9SP/c50vi3xrmrua/+6hfPbCS2ABNWfx24vPidzvC7krjU/RTo235sV776ymlsMtGKj8g==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"balanced-match": "^1.0.0",
|
||||
"concat-map": "0.0.1"
|
||||
@@ -551,14 +597,16 @@
|
||||
"version": "3.1.2",
|
||||
"resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz",
|
||||
"integrity": "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">= 0.8"
|
||||
}
|
||||
},
|
||||
"node_modules/call-bind-apply-helpers": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.1.tgz",
|
||||
"integrity": "sha512-BhYE+WDaywFg2TBWYNXAE+8B1ATnThNBqXHP5nQu0jWJdVvY2hvkpyB3qOmtmDePiS5/BDQ8wASEWGMWRG148g==",
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.2.tgz",
|
||||
"integrity": "sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"es-errors": "^1.3.0",
|
||||
"function-bind": "^1.1.2"
|
||||
@@ -568,12 +616,13 @@
|
||||
}
|
||||
},
|
||||
"node_modules/call-bound": {
|
||||
"version": "1.0.3",
|
||||
"resolved": "https://registry.npmjs.org/call-bound/-/call-bound-1.0.3.tgz",
|
||||
"integrity": "sha512-YTd+6wGlNlPxSuri7Y6X8tY2dmm12UMH66RpKMhiX6rsk5wXXnYgbUcOt8kiS31/AjfoTOvCsE+w8nZQLQnzHA==",
|
||||
"version": "1.0.4",
|
||||
"resolved": "https://registry.npmjs.org/call-bound/-/call-bound-1.0.4.tgz",
|
||||
"integrity": "sha512-+ys997U96po4Kx/ABpBCqhA9EuxJaQWDQg7295H4hBphv3IZg0boBKuwYpt4YXp6MZ5AmZQnU/tyMTlRpaSejg==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"call-bind-apply-helpers": "^1.0.1",
|
||||
"get-intrinsic": "^1.2.6"
|
||||
"call-bind-apply-helpers": "^1.0.2",
|
||||
"get-intrinsic": "^1.3.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.4"
|
||||
@@ -646,6 +695,7 @@
|
||||
"version": "1.0.8",
|
||||
"resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz",
|
||||
"integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"delayed-stream": "~1.0.0"
|
||||
},
|
||||
@@ -729,6 +779,7 @@
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz",
|
||||
"integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=0.4.0"
|
||||
}
|
||||
@@ -778,14 +829,17 @@
|
||||
}
|
||||
},
|
||||
"node_modules/dottie": {
|
||||
"version": "2.0.6",
|
||||
"resolved": "https://registry.npmjs.org/dottie/-/dottie-2.0.6.tgz",
|
||||
"integrity": "sha512-iGCHkfUc5kFekGiqhe8B/mdaurD+lakO9txNnTvKtA6PISrw86LgqHvRzWYPyoE2Ph5aMIrCw9/uko6XHTKCwA=="
|
||||
"version": "2.0.7",
|
||||
"resolved": "https://registry.npmjs.org/dottie/-/dottie-2.0.7.tgz",
|
||||
"integrity": "sha512-7lAK2A0b3zZr3UC5aE69CPdCFR4RHW1o2Dr74TqFykxkUCBXSRJum/yPc7g8zRHJqWKomPLHwFLLoUnn8PXXRg==",
|
||||
"deprecated": "Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/dunder-proto": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.1.tgz",
|
||||
"integrity": "sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"call-bind-apply-helpers": "^1.0.1",
|
||||
"es-errors": "^1.3.0",
|
||||
@@ -812,6 +866,7 @@
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.1.tgz",
|
||||
"integrity": "sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">= 0.4"
|
||||
}
|
||||
@@ -820,14 +875,16 @@
|
||||
"version": "1.3.0",
|
||||
"resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz",
|
||||
"integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">= 0.4"
|
||||
}
|
||||
},
|
||||
"node_modules/es-object-atoms": {
|
||||
"version": "1.1.1",
|
||||
"resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.1.1.tgz",
|
||||
"integrity": "sha512-FGgH2h8zKNim9ljj7dankFPcICIK9Cp5bm+c2gQSYePhpaG5+esrLODihIorn+Pe6FGJzWhXQotPv73jTaldXA==",
|
||||
"version": "1.1.2",
|
||||
"resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.1.2.tgz",
|
||||
"integrity": "sha512-HWcBoN6NileqtSydK2FqHbS/LoDd2pqrnQHLyJzBj4kOp/ky2MWMN694xOfkK8/SnUsW2DH7EfyVlydKCsm1Zw==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"es-errors": "^1.3.0"
|
||||
},
|
||||
@@ -835,6 +892,21 @@
|
||||
"node": ">= 0.4"
|
||||
}
|
||||
},
|
||||
"node_modules/es-set-tostringtag": {
|
||||
"version": "2.1.0",
|
||||
"resolved": "https://registry.npmjs.org/es-set-tostringtag/-/es-set-tostringtag-2.1.0.tgz",
|
||||
"integrity": "sha512-j6vWzfrGVfyXxge+O0x5sh6cvxAog0a/4Rdd2K36zCMV5eJ+/+tOAngRO8cODMNWbVRdVlmGZQL2YS3yR8bIUA==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"es-errors": "^1.3.0",
|
||||
"get-intrinsic": "^1.2.6",
|
||||
"has-tostringtag": "^1.0.2",
|
||||
"hasown": "^2.0.2"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.4"
|
||||
}
|
||||
},
|
||||
"node_modules/escape-html": {
|
||||
"version": "1.0.3",
|
||||
"resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz",
|
||||
@@ -849,38 +921,39 @@
|
||||
}
|
||||
},
|
||||
"node_modules/express": {
|
||||
"version": "4.21.2",
|
||||
"resolved": "https://registry.npmjs.org/express/-/express-4.21.2.tgz",
|
||||
"integrity": "sha512-28HqgMZAmih1Czt9ny7qr6ek2qddF4FclbMzwhCREB6OFfH+rXAnuNCwo1/wFvrtbgsQDb4kSbX9de9lFbrXnA==",
|
||||
"version": "4.22.2",
|
||||
"resolved": "https://registry.npmjs.org/express/-/express-4.22.2.tgz",
|
||||
"integrity": "sha512-IuL+Elrou2ZvCFHs18/CIzy2Nzvo25nZ1/D2eIZlz7c+QUayAcYoiM2BthCjs+EBHVpjYjcuLDAiCWgeIX3X1Q==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"accepts": "~1.3.8",
|
||||
"array-flatten": "1.1.1",
|
||||
"body-parser": "1.20.3",
|
||||
"content-disposition": "0.5.4",
|
||||
"body-parser": "~1.20.5",
|
||||
"content-disposition": "~0.5.4",
|
||||
"content-type": "~1.0.4",
|
||||
"cookie": "0.7.1",
|
||||
"cookie-signature": "1.0.6",
|
||||
"cookie": "~0.7.1",
|
||||
"cookie-signature": "~1.0.6",
|
||||
"debug": "2.6.9",
|
||||
"depd": "2.0.0",
|
||||
"encodeurl": "~2.0.0",
|
||||
"escape-html": "~1.0.3",
|
||||
"etag": "~1.8.1",
|
||||
"finalhandler": "1.3.1",
|
||||
"fresh": "0.5.2",
|
||||
"http-errors": "2.0.0",
|
||||
"finalhandler": "~1.3.1",
|
||||
"fresh": "~0.5.2",
|
||||
"http-errors": "~2.0.0",
|
||||
"merge-descriptors": "1.0.3",
|
||||
"methods": "~1.1.2",
|
||||
"on-finished": "2.4.1",
|
||||
"on-finished": "~2.4.1",
|
||||
"parseurl": "~1.3.3",
|
||||
"path-to-regexp": "0.1.12",
|
||||
"path-to-regexp": "~0.1.12",
|
||||
"proxy-addr": "~2.0.7",
|
||||
"qs": "6.13.0",
|
||||
"qs": "~6.15.1",
|
||||
"range-parser": "~1.2.1",
|
||||
"safe-buffer": "5.2.1",
|
||||
"send": "0.19.0",
|
||||
"serve-static": "1.16.2",
|
||||
"send": "~0.19.0",
|
||||
"serve-static": "~1.16.2",
|
||||
"setprototypeof": "1.2.0",
|
||||
"statuses": "2.0.1",
|
||||
"statuses": "~2.0.1",
|
||||
"type-is": "~1.6.18",
|
||||
"utils-merge": "1.0.1",
|
||||
"vary": "~1.1.2"
|
||||
@@ -948,15 +1021,16 @@
|
||||
"integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A=="
|
||||
},
|
||||
"node_modules/follow-redirects": {
|
||||
"version": "1.15.9",
|
||||
"resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.9.tgz",
|
||||
"integrity": "sha512-gew4GsXizNgdoRyqmyfMHyAmXsZDk6mHkSxZFCzW9gwlbtOW44CDtYavM+y+72qD/Vq2l550kMF52DT8fOLJqQ==",
|
||||
"version": "1.16.0",
|
||||
"resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.16.0.tgz",
|
||||
"integrity": "sha512-y5rN/uOsadFT/JfYwhxRS5R7Qce+g3zG97+JrtFZlC9klX/W5hD7iiLzScI4nZqUS7DNUdhPgw4xI8W2LuXlUw==",
|
||||
"funding": [
|
||||
{
|
||||
"type": "individual",
|
||||
"url": "https://github.com/sponsors/RubenVerborgh"
|
||||
}
|
||||
],
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=4.0"
|
||||
},
|
||||
@@ -967,12 +1041,15 @@
|
||||
}
|
||||
},
|
||||
"node_modules/form-data": {
|
||||
"version": "4.0.1",
|
||||
"resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.1.tgz",
|
||||
"integrity": "sha512-tzN8e4TX8+kkxGPK8D5u0FNmjPUjw3lwC9lSLxxoB/+GtsJG91CO8bSWy73APlgAZzZbXEYZJuxjkHH2w+Ezhw==",
|
||||
"version": "4.0.5",
|
||||
"resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.5.tgz",
|
||||
"integrity": "sha512-8RipRLol37bNs2bhoV67fiTEvdTrbMUYcFTiy3+wuuOnUog2QBHCZWXDRijWQfAkhBj2Uf5UnVaiWwA5vdd82w==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"asynckit": "^0.4.0",
|
||||
"combined-stream": "^1.0.8",
|
||||
"es-set-tostringtag": "^2.1.0",
|
||||
"hasown": "^2.0.2",
|
||||
"mime-types": "^2.1.12"
|
||||
},
|
||||
"engines": {
|
||||
@@ -1025,16 +1102,17 @@
|
||||
}
|
||||
},
|
||||
"node_modules/get-intrinsic": {
|
||||
"version": "1.2.7",
|
||||
"resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.7.tgz",
|
||||
"integrity": "sha512-VW6Pxhsrk0KAOqs3WEd0klDiF/+V7gQOpAvY1jVU/LHmaD/kQO4523aiJuikX/QAKYiW6x8Jh+RJej1almdtCA==",
|
||||
"version": "1.3.0",
|
||||
"resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.3.0.tgz",
|
||||
"integrity": "sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"call-bind-apply-helpers": "^1.0.1",
|
||||
"call-bind-apply-helpers": "^1.0.2",
|
||||
"es-define-property": "^1.0.1",
|
||||
"es-errors": "^1.3.0",
|
||||
"es-object-atoms": "^1.0.0",
|
||||
"es-object-atoms": "^1.1.1",
|
||||
"function-bind": "^1.1.2",
|
||||
"get-proto": "^1.0.0",
|
||||
"get-proto": "^1.0.1",
|
||||
"gopd": "^1.2.0",
|
||||
"has-symbols": "^1.1.0",
|
||||
"hasown": "^2.0.2",
|
||||
@@ -1051,6 +1129,7 @@
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/get-proto/-/get-proto-1.0.1.tgz",
|
||||
"integrity": "sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"dunder-proto": "^1.0.1",
|
||||
"es-object-atoms": "^1.0.0"
|
||||
@@ -1074,6 +1153,7 @@
|
||||
"version": "1.2.0",
|
||||
"resolved": "https://registry.npmjs.org/gopd/-/gopd-1.2.0.tgz",
|
||||
"integrity": "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">= 0.4"
|
||||
},
|
||||
@@ -1093,6 +1173,22 @@
|
||||
"version": "1.1.0",
|
||||
"resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.1.0.tgz",
|
||||
"integrity": "sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">= 0.4"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/ljharb"
|
||||
}
|
||||
},
|
||||
"node_modules/has-tostringtag": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.2.tgz",
|
||||
"integrity": "sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"has-symbols": "^1.0.3"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.4"
|
||||
},
|
||||
@@ -1126,10 +1222,24 @@
|
||||
"node": ">= 0.8"
|
||||
}
|
||||
},
|
||||
"node_modules/https-proxy-agent": {
|
||||
"version": "5.0.1",
|
||||
"resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz",
|
||||
"integrity": "sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"agent-base": "6",
|
||||
"debug": "4"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 6"
|
||||
}
|
||||
},
|
||||
"node_modules/iconv-lite": {
|
||||
"version": "0.4.24",
|
||||
"resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz",
|
||||
"integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"safer-buffer": ">= 2.1.2 < 3"
|
||||
},
|
||||
@@ -1217,9 +1327,10 @@
|
||||
"integrity": "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ=="
|
||||
},
|
||||
"node_modules/lodash": {
|
||||
"version": "4.17.21",
|
||||
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz",
|
||||
"integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg=="
|
||||
"version": "4.18.1",
|
||||
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.18.1.tgz",
|
||||
"integrity": "sha512-dMInicTPVE8d1e5otfwmmjlxkZoUpiVLwyeTdUsi/Caj/gfzzblBcCE5sRHV/AsjuCmxWrte2TNGSYuCeCq+0Q==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/long": {
|
||||
"version": "5.2.4",
|
||||
@@ -1252,6 +1363,7 @@
|
||||
"version": "1.1.0",
|
||||
"resolved": "https://registry.npmjs.org/math-intrinsics/-/math-intrinsics-1.1.0.tgz",
|
||||
"integrity": "sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">= 0.4"
|
||||
}
|
||||
@@ -1311,9 +1423,10 @@
|
||||
}
|
||||
},
|
||||
"node_modules/minimatch": {
|
||||
"version": "3.1.2",
|
||||
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz",
|
||||
"integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==",
|
||||
"version": "3.1.5",
|
||||
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.5.tgz",
|
||||
"integrity": "sha512-VgjWUsnnT6n+NUk6eZq77zeFdpW2LWDzP6zFGrCbHXiYNul5Dzqk2HHQ5uFH2DNW5Xbp8+jVzaeNt94ssEEl4w==",
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"brace-expansion": "^1.1.7"
|
||||
},
|
||||
@@ -1474,9 +1587,10 @@
|
||||
}
|
||||
},
|
||||
"node_modules/object-inspect": {
|
||||
"version": "1.13.3",
|
||||
"resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.3.tgz",
|
||||
"integrity": "sha512-kDCGIbxkDSXE3euJZZXzc6to7fCrKHNI/hSRQnRuQ+BWjFNzZwiFF8fj/6o2t2G9/jTj8PSIYTfCLelLZEeRpA==",
|
||||
"version": "1.13.4",
|
||||
"resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.4.tgz",
|
||||
"integrity": "sha512-W67iLl4J2EXEGTbfeHCffrjDfitvLANg0UlX3wFUUSTx92KXRFegMHUVgSqE+wvhAbi4WqjGg9czysTV2Epbew==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">= 0.4"
|
||||
},
|
||||
@@ -1509,9 +1623,10 @@
|
||||
}
|
||||
},
|
||||
"node_modules/path-to-regexp": {
|
||||
"version": "0.1.12",
|
||||
"resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.12.tgz",
|
||||
"integrity": "sha512-RA1GjUVMnvYFxuqovrEqZoxxW5NUZqbwKtYz/Tt7nXerk0LbLblQmrsgdeOxV5SFHf0UDggjS/bSeOZwt1pmEQ=="
|
||||
"version": "0.1.13",
|
||||
"resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.13.tgz",
|
||||
"integrity": "sha512-A/AGNMFN3c8bOlvV9RreMdrv7jsmF9XIfDeCd87+I8RNg6s78BhJxMu69NEMHBSJFxKidViTEdruRwEk/WIKqA==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/pg-connection-string": {
|
||||
"version": "2.7.0",
|
||||
@@ -1519,9 +1634,10 @@
|
||||
"integrity": "sha512-PI2W9mv53rXJQEOb8xNR8lH7Hr+EKa6oJa38zsK0S/ky2er16ios1wLKhZyxzD7jUReiWokc9WK5nxSnC7W1TA=="
|
||||
},
|
||||
"node_modules/picomatch": {
|
||||
"version": "2.3.1",
|
||||
"resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz",
|
||||
"integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==",
|
||||
"version": "2.3.2",
|
||||
"resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.2.tgz",
|
||||
"integrity": "sha512-V7+vQEJ06Z+c5tSye8S+nHUfI51xoXIXjHQ99cQtKUkQqqO1kO/KCJUfZXuB47h/YBlDhah2H3hdUGXn8ie0oA==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=8.6"
|
||||
},
|
||||
@@ -1547,9 +1663,13 @@
|
||||
}
|
||||
},
|
||||
"node_modules/proxy-from-env": {
|
||||
"version": "1.1.0",
|
||||
"resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz",
|
||||
"integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg=="
|
||||
"version": "2.1.0",
|
||||
"resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-2.1.0.tgz",
|
||||
"integrity": "sha512-cJ+oHTW1VAEa8cJslgmUZrc+sjRKgAKl3Zyse6+PV38hZe/V6Z14TbCuXcan9F9ghlz4QrFr2c92TNF82UkYHA==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=10"
|
||||
}
|
||||
},
|
||||
"node_modules/pstree.remy": {
|
||||
"version": "1.1.8",
|
||||
@@ -1557,11 +1677,12 @@
|
||||
"integrity": "sha512-77DZwxQmxKnu3aR542U+X8FypNzbfJ+C5XQDk3uWjWxn6151aIMGthWYRXTqT1E5oJvg+ljaa2OJi+VfvCOQ8w=="
|
||||
},
|
||||
"node_modules/qs": {
|
||||
"version": "6.13.0",
|
||||
"resolved": "https://registry.npmjs.org/qs/-/qs-6.13.0.tgz",
|
||||
"integrity": "sha512-+38qI9SOr8tfZ4QmJNplMUxqjbe7LKvvZgWdExBOmd+egZTtjLB67Gu0HRX3u/XOq7UU2Nx6nsjvS16Z9uwfpg==",
|
||||
"version": "6.15.2",
|
||||
"resolved": "https://registry.npmjs.org/qs/-/qs-6.15.2.tgz",
|
||||
"integrity": "sha512-Rzq0KEyX/w/tEybncDgdkZrJgVUsUMk3xjh3t5bv3S1HTAtg+uOYt72+ZfwiQwKdysThkTBdL/rTi6HDmX9Ddw==",
|
||||
"license": "BSD-3-Clause",
|
||||
"dependencies": {
|
||||
"side-channel": "^1.0.6"
|
||||
"side-channel": "^1.1.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=0.6"
|
||||
@@ -1579,19 +1700,49 @@
|
||||
}
|
||||
},
|
||||
"node_modules/raw-body": {
|
||||
"version": "2.5.2",
|
||||
"resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.5.2.tgz",
|
||||
"integrity": "sha512-8zGqypfENjCIqGhgXToC8aB2r7YrBX+AQAfIPs/Mlk+BtPTztOvTS01NRW/3Eh60J+a48lt8qsCzirQ6loCVfA==",
|
||||
"version": "2.5.3",
|
||||
"resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.5.3.tgz",
|
||||
"integrity": "sha512-s4VSOf6yN0rvbRZGxs8Om5CWj6seneMwK3oDb4lWDH0UPhWcxwOWw5+qk24bxq87szX1ydrwylIOp2uG1ojUpA==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"bytes": "3.1.2",
|
||||
"http-errors": "2.0.0",
|
||||
"iconv-lite": "0.4.24",
|
||||
"unpipe": "1.0.0"
|
||||
"bytes": "~3.1.2",
|
||||
"http-errors": "~2.0.1",
|
||||
"iconv-lite": "~0.4.24",
|
||||
"unpipe": "~1.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.8"
|
||||
}
|
||||
},
|
||||
"node_modules/raw-body/node_modules/http-errors": {
|
||||
"version": "2.0.1",
|
||||
"resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.1.tgz",
|
||||
"integrity": "sha512-4FbRdAX+bSdmo4AUFuS0WNiPz8NgFt+r8ThgNWmlrjQjt1Q7ZR9+zTlce2859x4KSXrwIsaeTqDoKQmtP8pLmQ==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"depd": "~2.0.0",
|
||||
"inherits": "~2.0.4",
|
||||
"setprototypeof": "~1.2.0",
|
||||
"statuses": "~2.0.2",
|
||||
"toidentifier": "~1.0.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.8"
|
||||
},
|
||||
"funding": {
|
||||
"type": "opencollective",
|
||||
"url": "https://opencollective.com/express"
|
||||
}
|
||||
},
|
||||
"node_modules/raw-body/node_modules/statuses": {
|
||||
"version": "2.0.2",
|
||||
"resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.2.tgz",
|
||||
"integrity": "sha512-DvEy55V3DB7uknRo+4iOGT5fP1slR8wQohVdknigZPMpMstaKJQWhwiYBACJE3Ul2pTnATihhBYnRhZQHGBiRw==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">= 0.8"
|
||||
}
|
||||
},
|
||||
"node_modules/readable-stream": {
|
||||
"version": "2.3.8",
|
||||
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.8.tgz",
|
||||
@@ -1712,15 +1863,16 @@
|
||||
"integrity": "sha512-hr3Wtp/GZIc/6DAGPDcV4/9WoZhjrkXsi5B/07QgX8tsdc6ilr7BFM6PM6rbdAX1kFSDYeZGLipIZZKyQP0O5Q=="
|
||||
},
|
||||
"node_modules/sequelize": {
|
||||
"version": "6.37.5",
|
||||
"resolved": "https://registry.npmjs.org/sequelize/-/sequelize-6.37.5.tgz",
|
||||
"integrity": "sha512-10WA4poUb3XWnUROThqL2Apq9C2NhyV1xHPMZuybNMCucDsbbFuKg51jhmyvvAUyUqCiimwTZamc3AHhMoBr2Q==",
|
||||
"version": "6.37.8",
|
||||
"resolved": "https://registry.npmjs.org/sequelize/-/sequelize-6.37.8.tgz",
|
||||
"integrity": "sha512-HJ0IQFqcTsTiqbEgiuioYFMSD00TP6Cz7zoTti+zVVBwVe9fEhev9cH6WnM3XU31+ABS356durAb99ZuOthnKw==",
|
||||
"funding": [
|
||||
{
|
||||
"type": "opencollective",
|
||||
"url": "https://opencollective.com/sequelize"
|
||||
}
|
||||
],
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@types/debug": "^4.1.8",
|
||||
"@types/validator": "^13.7.17",
|
||||
@@ -1849,6 +2001,7 @@
|
||||
"version": "1.1.0",
|
||||
"resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.1.0.tgz",
|
||||
"integrity": "sha512-ZX99e6tRweoUXqR+VBrslhda51Nh5MTQwou5tnUDgbtyM0dBgmhEDtWGP/xbKn6hqfPRHujUNwz5fy/wbbhnpw==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"es-errors": "^1.3.0",
|
||||
"object-inspect": "^1.13.3",
|
||||
@@ -1864,12 +2017,13 @@
|
||||
}
|
||||
},
|
||||
"node_modules/side-channel-list": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/side-channel-list/-/side-channel-list-1.0.0.tgz",
|
||||
"integrity": "sha512-FCLHtRD/gnpCiCHEiJLOwdmFP+wzCmDEkc9y7NsYxeF4u7Btsn1ZuwgwJGxImImHicJArLP4R0yX4c2KCrMrTA==",
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/side-channel-list/-/side-channel-list-1.0.1.tgz",
|
||||
"integrity": "sha512-mjn/0bi/oUURjc5Xl7IaWi/OJJJumuoJFQJfDDyO46+hBWsfaVM65TBHq2eoZBhzl9EchxOijpkbRC8SVBQU0w==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"es-errors": "^1.3.0",
|
||||
"object-inspect": "^1.13.3"
|
||||
"object-inspect": "^1.13.4"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.4"
|
||||
@@ -1882,6 +2036,7 @@
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/side-channel-map/-/side-channel-map-1.0.1.tgz",
|
||||
"integrity": "sha512-VCjCNfgMsby3tTdo02nbjtM/ewra6jPHmpThenkTYh8pG9ucZ/1P8So4u4FGBek/BjpOVsDCMoLA/iuBKIFXRA==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"call-bound": "^1.0.2",
|
||||
"es-errors": "^1.3.0",
|
||||
@@ -1899,6 +2054,7 @@
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/side-channel-weakmap/-/side-channel-weakmap-1.0.2.tgz",
|
||||
"integrity": "sha512-WPS/HvHQTYnHisLo9McqBHOJk2FkHO/tlpvldyrnem4aeQp4hai3gythswg6p01oSoTl58rcpiFAjF2br2Ak2A==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"call-bound": "^1.0.2",
|
||||
"es-errors": "^1.3.0",
|
||||
@@ -2067,21 +2223,23 @@
|
||||
}
|
||||
},
|
||||
"node_modules/uuid": {
|
||||
"version": "11.0.5",
|
||||
"resolved": "https://registry.npmjs.org/uuid/-/uuid-11.0.5.tgz",
|
||||
"integrity": "sha512-508e6IcKLrhxKdBbcA2b4KQZlLVp2+J5UwQ6F7Drckkc5N9ZJwFa4TgWtsww9UG8fGHbm6gbV19TdM5pQ4GaIA==",
|
||||
"version": "11.1.1",
|
||||
"resolved": "https://registry.npmjs.org/uuid/-/uuid-11.1.1.tgz",
|
||||
"integrity": "sha512-vIYxrBCC/N/K+Js3qSN88go7kIfNPssr/hHCesKCQNAjmgvYS2oqr69kIufEG+O4+PfezOH4EbIeHCfFov8ZgQ==",
|
||||
"funding": [
|
||||
"https://github.com/sponsors/broofa",
|
||||
"https://github.com/sponsors/ctavan"
|
||||
],
|
||||
"license": "MIT",
|
||||
"bin": {
|
||||
"uuid": "dist/esm/bin/uuid"
|
||||
}
|
||||
},
|
||||
"node_modules/validator": {
|
||||
"version": "13.12.0",
|
||||
"resolved": "https://registry.npmjs.org/validator/-/validator-13.12.0.tgz",
|
||||
"integrity": "sha512-c1Q0mCiPlgdTVVVIJIrBuxNicYE+t/7oKeI9MWLj3fh/uq2Pxh/3eeWbVZ4OcGW1TUf53At0njHw5SMdA3tmMg==",
|
||||
"version": "13.15.35",
|
||||
"resolved": "https://registry.npmjs.org/validator/-/validator-13.15.35.tgz",
|
||||
"integrity": "sha512-TQ5pAGhd5whStmqWvYF4OjQROlmv9SMFVt37qoCBdqRffuuklWYQlCNnEs2ZaIBD1kZRNnikiZOS1eqgkar0iw==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">= 0.10"
|
||||
}
|
||||
|
||||
@@ -0,0 +1,42 @@
|
||||
const express = require('express');
|
||||
const aiQueryRouter = express.Router();
|
||||
|
||||
const aiQueryController = require('../controllers/aiQueryController');
|
||||
|
||||
// ! /ai-query
|
||||
|
||||
// * Watch history
|
||||
aiQueryRouter.get('/recently-watched/movies', aiQueryController.getRecentlyWatchedMovies);
|
||||
aiQueryRouter.get('/recently-watched/episodes', aiQueryController.getRecentlyWatchedEpisodes);
|
||||
|
||||
// * Library lists
|
||||
aiQueryRouter.get('/watchlist', aiQueryController.getWatchlist);
|
||||
aiQueryRouter.get('/favorites', aiQueryController.getFavorites);
|
||||
|
||||
// * Library overview & search
|
||||
aiQueryRouter.get('/library/overview', aiQueryController.getLibraryOverview);
|
||||
aiQueryRouter.get('/library/search', aiQueryController.searchLibrary);
|
||||
|
||||
// * Upcoming
|
||||
aiQueryRouter.get('/upcoming', aiQueryController.getUpcoming);
|
||||
|
||||
// * Entry detail
|
||||
aiQueryRouter.get('/entry/:id', aiQueryController.getEntryDetail);
|
||||
|
||||
// * Genres
|
||||
aiQueryRouter.get('/genres/breakdown', aiQueryController.getGenreBreakdown);
|
||||
|
||||
// * Collections
|
||||
aiQueryRouter.get('/collections', aiQueryController.getAllCollections);
|
||||
aiQueryRouter.get('/collections/:id', aiQueryController.getCollectionDetail);
|
||||
|
||||
// * TV series
|
||||
aiQueryRouter.get('/tv-series/in-progress', aiQueryController.getInProgressSeries);
|
||||
|
||||
// * Stats
|
||||
aiQueryRouter.get('/stats/watching-time', aiQueryController.getWatchTimeStats);
|
||||
|
||||
// * People
|
||||
aiQueryRouter.get('/person/:id', aiQueryController.getPersonDetail);
|
||||
|
||||
module.exports = aiQueryRouter;
|
||||
+35
-33
@@ -1,34 +1,36 @@
|
||||
const express = require('express');
|
||||
const collectionRouter = require('./collection.routes');
|
||||
const entrySeenRouter = require('./entry-seen.routes');
|
||||
const entryRouter = require('./entry.routes');
|
||||
const seasonRouter = require('./season.routes');
|
||||
const episodeSeenRouter = require('./episode-seen.routes');
|
||||
const settingsRouter = require('./settings.routes');
|
||||
const maintenanceRouter = require('./maintenance.routes');
|
||||
const statisticsRouter = require('./statistics.routes');
|
||||
const mediaRouter = require('./media.routes');
|
||||
const episodeRouter = require('./episode.routes');
|
||||
const pingRouter = require('./ping.routes');
|
||||
const importRouter = require('./import.routes');
|
||||
const peopleRouter = require('./people.routes');
|
||||
|
||||
const router = express.Router();
|
||||
router.use('/media', mediaRouter);
|
||||
router.use('/entries', entryRouter);
|
||||
router.use('/collections', collectionRouter);
|
||||
router.use('/entry-seen', entrySeenRouter);
|
||||
|
||||
router.use('/seasons', seasonRouter);
|
||||
router.use('/episodes', episodeRouter);
|
||||
router.use('/episode-seen', episodeSeenRouter);
|
||||
|
||||
|
||||
router.use('/import', importRouter);
|
||||
router.use('/statistics', statisticsRouter);
|
||||
router.use('/settings', settingsRouter);
|
||||
router.use('/maintenance', maintenanceRouter);
|
||||
router.use('/ping', pingRouter);
|
||||
router.use('/people', peopleRouter);
|
||||
|
||||
const express = require('express');
|
||||
const collectionRouter = require('./collection.routes');
|
||||
const entrySeenRouter = require('./entry-seen.routes');
|
||||
const entryRouter = require('./entry.routes');
|
||||
const seasonRouter = require('./season.routes');
|
||||
const episodeSeenRouter = require('./episode-seen.routes');
|
||||
const settingsRouter = require('./settings.routes');
|
||||
const maintenanceRouter = require('./maintenance.routes');
|
||||
const statisticsRouter = require('./statistics.routes');
|
||||
const mediaRouter = require('./media.routes');
|
||||
const episodeRouter = require('./episode.routes');
|
||||
const pingRouter = require('./ping.routes');
|
||||
const importRouter = require('./import.routes');
|
||||
const peopleRouter = require('./people.routes');
|
||||
const aiQueryRouter = require('./ai-query.routes');
|
||||
|
||||
const router = express.Router();
|
||||
router.use('/media', mediaRouter);
|
||||
router.use('/entries', entryRouter);
|
||||
router.use('/collections', collectionRouter);
|
||||
router.use('/entry-seen', entrySeenRouter);
|
||||
|
||||
router.use('/seasons', seasonRouter);
|
||||
router.use('/episodes', episodeRouter);
|
||||
router.use('/episode-seen', episodeSeenRouter);
|
||||
|
||||
|
||||
router.use('/import', importRouter);
|
||||
router.use('/statistics', statisticsRouter);
|
||||
router.use('/settings', settingsRouter);
|
||||
router.use('/maintenance', maintenanceRouter);
|
||||
router.use('/ping', pingRouter);
|
||||
router.use('/people', peopleRouter);
|
||||
router.use('/ai-query', aiQueryRouter);
|
||||
|
||||
module.exports = router;
|
||||
Reference in new issue
Block a user