Files
Showy/backend/models/People.js
T
Mohammed Abad 25b645a16f feat(backend): add TMDB preview endpoint for non-library entries
- Add GET /entries/tmdb/preview/:type/:tmdbId endpoint in entryController.js
- Fetch TMDB data via tmdbService.fetchEntryData() without persisting to DB
- Return normalized preview object with title, poster, genres, rating, season/episode counts
2026-04-27 04:03:02 +01:00

36 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) },
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;