Files
Showy/backend/models/People.js
T
X4Lo a9ff2d089a Store full TMDB data, add rate limiting and stale-entry refresh
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
2026-11-05 11:39:15 +00:00

38 lines
1.3 KiB
JavaScript

const { DataTypes } = require("sequelize");
const sequelize = require("../config/database");
const People = sequelize.define("peoples", {
id: { type: DataTypes.INTEGER, primaryKey: true, autoIncrement: true },
tmdb_id: { type: DataTypes.STRING(100) },
name: { type: DataTypes.STRING(100) },
original_name: { type: DataTypes.STRING(200) },
birthday: { type: DataTypes.DATEONLY },
deathday: { type: DataTypes.DATEONLY, allowNull: true },
gender: { type: DataTypes.INTEGER },
biography: { type: DataTypes.TEXT },
place_of_birth: { type: DataTypes.STRING(100), field: "place_of_birth" },
adult: { type: DataTypes.BOOLEAN, defaultValue: false },
popularity: { type: DataTypes.FLOAT },
known_for_department: {
type: DataTypes.STRING(50),
field: "known_for_department",
},
homepage: { type: DataTypes.STRING(200), allowNull: true },
imdb_id: { type: DataTypes.STRING(20), field: "imdb_id" },
profile_path: { type: DataTypes.STRING(200), field: "profile_path" },
last_fetch: { type: DataTypes.DATEONLY, field: "last_fetch" },
profile_update: { type: DataTypes.DATEONLY, field: "profile_update" },
fully_fetched: { type: DataTypes.BOOLEAN, defaultValue: false },
favorite: { type: DataTypes.BOOLEAN, defaultValue: false },
pinned: { type: DataTypes.BOOLEAN, defaultValue: false },
});
module.exports = People;