Backend - Route all TMDB requests through a rate limiter (20 req/s, 8 concurrent) with 429/5xx retries; stop logging the API key - Fetch external ids, certification, keywords, videos, watch providers and alternative titles in the entry details request - Shared entry mapper used by create, refresh, season refresh and importer - New columns on entries, ids, ratings, seasons, episodes and people, with an idempotent startup migration (adds missing columns, widens types) - Fix TV IMDb ids, network country/logo, episode tmdb_id on refresh, and genre/network removal on refresh - Add stale-entries maintenance job (count, start, cancel) and live recommendations endpoint Frontend - Entry page: certification, tagline, creators, in-app trailer, vote count, TV/movie details, network logos, external links, keywords, where to watch, and recommendations - Episode page: directors, writers and guest stars - Settings: TMDB refresh card with live progress
41 lines
1.1 KiB
JavaScript
41 lines
1.1 KiB
JavaScript
const { DataTypes } = require("sequelize");
|
|
const sequelize = require("../config/database");
|
|
|
|
const Episode = sequelize.define("episode", {
|
|
id: { type: DataTypes.INTEGER, primaryKey: true, autoIncrement: true },
|
|
|
|
tmdb_id: { type: DataTypes.STRING(30) },
|
|
imdb_id: { type: DataTypes.STRING(30) },
|
|
tvdb_id: { type: DataTypes.STRING(30) },
|
|
|
|
season_id: {
|
|
type: DataTypes.INTEGER,
|
|
references: {
|
|
model: "Seasons",
|
|
key: "id",
|
|
},
|
|
},
|
|
|
|
name: { type: DataTypes.STRING(500) },
|
|
overview: { type: DataTypes.STRING(3000) },
|
|
episode_number: { type: DataTypes.INTEGER },
|
|
episode_type: { type: DataTypes.STRING(60) },
|
|
runtime: { type: DataTypes.INTEGER },
|
|
air_date: { type: DataTypes.DATE },
|
|
|
|
user_rating: { type: DataTypes.FLOAT },
|
|
tmdb_rating: { type: DataTypes.FLOAT },
|
|
tmdb_vote_count: { type: DataTypes.INTEGER },
|
|
|
|
production_code: { type: DataTypes.STRING(50) },
|
|
crew: { type: DataTypes.JSON },
|
|
guest_stars: { type: DataTypes.JSON },
|
|
|
|
still_path: { type: DataTypes.STRING(200) },
|
|
|
|
date_first_seen: { type: DataTypes.DATEONLY },
|
|
date_last_seen: { type: DataTypes.DATEONLY },
|
|
});
|
|
|
|
module.exports = Episode;
|