diff --git a/backend/models/Entry.js b/backend/models/Entry.js index bd5df5f..0df0096 100644 --- a/backend/models/Entry.js +++ b/backend/models/Entry.js @@ -18,10 +18,12 @@ const Entry = sequelize.define("entry", certification: { type: DataTypes.INTEGER }, network_studio: { type: DataTypes.STRING(40) }, collection_id: { type: DataTypes.INTEGER }, + max_cast: { type: DataTypes.INTEGER, defaultValue: 10 }, watchlist: { type: DataTypes.BOOLEAN, defaultValue: false }, favorit: { type: DataTypes.BOOLEAN, defaultValue: false }, hidden: { type: DataTypes.BOOLEAN, defaultValue: false }, + note: { type: DataTypes.STRING(2000) }, is_tvseries: { type: DataTypes.BOOLEAN }, status: { type: DataTypes.STRING(20) }, diff --git a/backend/routes/entryIdsRoutes.js b/backend/routes/entry-ids.routes.js similarity index 100% rename from backend/routes/entryIdsRoutes.js rename to backend/routes/entry-ids.routes.js diff --git a/backend/routes/entryRatingsRoutes.js b/backend/routes/entry-ratings.routes.js similarity index 100% rename from backend/routes/entryRatingsRoutes.js rename to backend/routes/entry-ratings.routes.js diff --git a/backend/routes/entrySeenRoutes.js b/backend/routes/entry-seen.routes.js similarity index 100% rename from backend/routes/entrySeenRoutes.js rename to backend/routes/entry-seen.routes.js diff --git a/backend/routes/entryRoutes.js b/backend/routes/entry.routes.js similarity index 100% rename from backend/routes/entryRoutes.js rename to backend/routes/entry.routes.js diff --git a/backend/routes/episodeSeenRoutes.js b/backend/routes/episode-seen.routes.js similarity index 100% rename from backend/routes/episodeSeenRoutes.js rename to backend/routes/episode-seen.routes.js diff --git a/backend/routes/episodeRoutes.js b/backend/routes/episode.routes.js similarity index 100% rename from backend/routes/episodeRoutes.js rename to backend/routes/episode.routes.js diff --git a/backend/routes/killerRoutes.js b/backend/routes/killer.routes.js similarity index 100% rename from backend/routes/killerRoutes.js rename to backend/routes/killer.routes.js diff --git a/backend/routes/routes.js b/backend/routes/routes.js index 2615f9d..70f6fcf 100644 --- a/backend/routes/routes.js +++ b/backend/routes/routes.js @@ -1,12 +1,11 @@ const express = require('express'); -const userCollectionRoutes = require('./userCollectionRoutes'); -const entryIdsRouter = require('./entryIdsRoutes'); -const entrySeenRouter = require('./entrySeenRoutes'); -const entryRouter = require('./entryRoutes'); -const entryRatingsRouter = require('./entryRatingsRoutes'); -const killerRouter = require('./killerRoutes'); -const seasonRouter = require('./seasonRoutes'); -const episodeSeenRouter = require('./episodeSeenRoutes'); +const userCollectionRoutes = require('./user-collection.routes'); +const entryIdsRouter = require('./entry-ids.routes'); +const entrySeenRouter = require('./entry-seen.routes'); +const entryRouter = require('./entry.routes'); +const entryRatingsRouter = require('./entry-ratings.routes'); +const seasonRouter = require('./season.routes'); +const episodeSeenRouter = require('./episode-seen.routes'); const router = express.Router(); @@ -19,8 +18,4 @@ router.use('/entry-ratings', entryRatingsRouter); router.use('/seasons', seasonRouter); router.use('/episode-seen', episodeSeenRouter); - - -router.use('/killer', killerRouter); // ! this route is used to crash the backend - module.exports = router; \ No newline at end of file diff --git a/backend/routes/seasonRoutes.js b/backend/routes/season.routes.js similarity index 100% rename from backend/routes/seasonRoutes.js rename to backend/routes/season.routes.js diff --git a/backend/routes/userCollectionRoutes.js b/backend/routes/user-collection.routes.js similarity index 100% rename from backend/routes/userCollectionRoutes.js rename to backend/routes/user-collection.routes.js diff --git a/backend/server.js b/backend/server.js index 56849a0..47a6df5 100644 --- a/backend/server.js +++ b/backend/server.js @@ -7,6 +7,10 @@ const path = require('path'); const app = express(); const PORT = process.env.PORT || 4000; +const relations = require('./db/relations.js'); +const sequelizeHooks = require('./db/sequelizeHooks.js'); +const { initializeGenres, initializeData } = require('./db/dataInitializer.js'); +const killerRouter = require('./routes/killer.routes.js'); // Middleware app.use(bodyParser.json()); // for parsing application/json @@ -50,14 +54,16 @@ app.use('/api/v1/media/:category/:type', (req, res, next) => { // * other api routes app.use('/api/v1', routes); + // ! Error handling middleware const errorHandler = require('./middleware/errorHandler'); app.use(errorHandler); +// ! KILLER ROUTE: used to crash the backend +app.use('/killer', killerRouter); + // Start the server -const relations = require('./db/relations.js'); -const sequelizeHooks = require('./db/sequelizeHooks.js'); -const { initializeGenres, initializeData } = require('./db/dataInitializer.js'); + console.log(`Syncing database schema...`); sequelize // .sync({force: true}) // will drop all tables and recreate them. diff --git a/frontend/src/app/shared/models/entry.model.ts b/frontend/src/app/shared/models/entry.model.ts index 9b1816f..62b16c1 100644 --- a/frontend/src/app/shared/models/entry.model.ts +++ b/frontend/src/app/shared/models/entry.model.ts @@ -24,11 +24,12 @@ export interface Entry { certification: number; network_studio: string; collection_id: number; + max_cast: number; watchlist: boolean; favorit: boolean; hidden: boolean; - isInLibrary: boolean; + note: string; is_tvseries: boolean; status: string; @@ -38,11 +39,13 @@ export interface Entry { genres: string[]; medias: Media[]; - - // temp fields + poster_path: string; banner_path: string; + // * front specific fields + isInLibrary: boolean; + createdAt: Date; updatedAt: Date; }