- Entry details page now also renders entries not in the library, using the TMDB preview mapped to the same entry shape; remove TmdbPreviewPage - Preview endpoint returns an entry-shaped object, TMDB seasons and directors - Artwork section: TMDB posters, backdrops and logos merged with the media table, with in-library badges, language filter and add-to-library - Record tmdb_path on downloaded media so TMDB images can be matched - Recommendations by TMDB id for entries not in the library
34 lines
940 B
JavaScript
34 lines
940 B
JavaScript
const { DataTypes, Sequelize } = require("sequelize");
|
|
const sequelize = require("../config/database");
|
|
|
|
const Media = sequelize.define("media", {
|
|
id: { type: DataTypes.INTEGER, primaryKey: true, autoIncrement: true },
|
|
|
|
mediaable: { type: Sequelize.STRING },
|
|
mediaableId: { type: Sequelize.INTEGER, field: "mediaable_id" },
|
|
|
|
type: { type: DataTypes.STRING(50) },
|
|
path: { type: DataTypes.STRING(200) },
|
|
// TMDB file_path this image was downloaded from (null for custom uploads)
|
|
tmdbPath: { type: DataTypes.STRING(200), field: "tmdb_path" },
|
|
|
|
isLocal: { type: DataTypes.BOOLEAN, field: "is_local" },
|
|
isSelected: {
|
|
type: DataTypes.BOOLEAN,
|
|
field: "is_selected",
|
|
defaultValue: false,
|
|
},
|
|
isCustom: {
|
|
type: DataTypes.BOOLEAN,
|
|
field: "is_custom",
|
|
defaultValue: false,
|
|
},
|
|
isFavorit: {
|
|
type: DataTypes.BOOLEAN,
|
|
field: "is_favorit",
|
|
defaultValue: false,
|
|
},
|
|
});
|
|
|
|
module.exports = Media;
|