Normalize to double quotes across all files with Prettier
This commit is contained in:
1 parent
73bff72cec
commit
a5659cf4c8
190 files changed
+9523
-8859
No files matched your search
@@ -1,56 +1,60 @@
|
||||
const express = require('express');
|
||||
const express = require("express");
|
||||
const peopleRouter = express.Router();
|
||||
const { peoplePicturesUpload } = require('../services/mutlerStorageLocations');
|
||||
const mediaOptimizerService = require('../services/mediaOptimizerService');
|
||||
const peopleController = require('../controllers/peopleController');
|
||||
const { peoplePicturesUpload } = require("../services/mutlerStorageLocations");
|
||||
const mediaOptimizerService = require("../services/mediaOptimizerService");
|
||||
const peopleController = require("../controllers/peopleController");
|
||||
|
||||
// ! /people
|
||||
|
||||
// ! TMDB PROXY ROUTES (must be before /:id to avoid matching)
|
||||
peopleRouter.get('/tmdb/popular', peopleController.getTmdbPopularPeople);
|
||||
peopleRouter.get('/tmdb/search', peopleController.searchTmdbPeople);
|
||||
peopleRouter.get('/tmdb/preview/:tmdbId', peopleController.getTmdbPersonPreview);
|
||||
peopleRouter.get("/tmdb/popular", peopleController.getTmdbPopularPeople);
|
||||
peopleRouter.get("/tmdb/search", peopleController.searchTmdbPeople);
|
||||
peopleRouter.get(
|
||||
"/tmdb/preview/:tmdbId",
|
||||
peopleController.getTmdbPersonPreview,
|
||||
);
|
||||
|
||||
// Get all people
|
||||
peopleRouter.get('/', peopleController.getAllPeople);
|
||||
peopleRouter.get("/", peopleController.getAllPeople);
|
||||
|
||||
// Get popular people
|
||||
peopleRouter.get('/popular', peopleController.getPopularPeople);
|
||||
peopleRouter.get("/popular", peopleController.getPopularPeople);
|
||||
|
||||
// Search people
|
||||
peopleRouter.get('/search', peopleController.searchPeople);
|
||||
peopleRouter.get("/search", peopleController.searchPeople);
|
||||
|
||||
// Get person by ID
|
||||
peopleRouter.get('/:id', peopleController.getPersonById);
|
||||
peopleRouter.get("/:id", peopleController.getPersonById);
|
||||
|
||||
// Get person credits (from DB)
|
||||
peopleRouter.get('/:id/credits', peopleController.getPersonCredits);
|
||||
peopleRouter.get("/:id/credits", peopleController.getPersonCredits);
|
||||
|
||||
// Get person TMDB filmography (all TMDB credits including non-library entries)
|
||||
peopleRouter.get('/:id/tmdb-filmography', peopleController.getPersonTmdbFilmography);
|
||||
peopleRouter.get(
|
||||
"/:id/tmdb-filmography",
|
||||
peopleController.getPersonTmdbFilmography,
|
||||
);
|
||||
|
||||
// Create a new person
|
||||
peopleRouter.post('/', peopleController.createPerson);
|
||||
peopleRouter.post("/", peopleController.createPerson);
|
||||
|
||||
// Fetch and save person from TMDB
|
||||
peopleRouter.post('/fetch', peopleController.fetchAndSavePersonByTmdbId);
|
||||
peopleRouter.post("/fetch", peopleController.fetchAndSavePersonByTmdbId);
|
||||
|
||||
// Update a person
|
||||
peopleRouter.put('/:id', peopleController.updatePerson);
|
||||
peopleRouter.put("/:id", peopleController.updatePerson);
|
||||
|
||||
// Refresh person data from TMDB
|
||||
peopleRouter.put('/:id/refresh', peopleController.refreshPerson);
|
||||
peopleRouter.put("/:id/refresh", peopleController.refreshPerson);
|
||||
|
||||
// Delete a person
|
||||
peopleRouter.delete('/:id', peopleController.deletePerson);
|
||||
peopleRouter.delete("/:id", peopleController.deletePerson);
|
||||
|
||||
// Person media upload handler
|
||||
const upload = peoplePicturesUpload.fields([
|
||||
{ name: 'profile', maxCount: 1 }
|
||||
]);
|
||||
const upload = peoplePicturesUpload.fields([{ name: "profile", maxCount: 1 }]);
|
||||
|
||||
// Upload person profile picture
|
||||
peopleRouter.post('/:id/media', upload, async (req, res) => {
|
||||
peopleRouter.post("/:id/media", upload, async (req, res) => {
|
||||
try {
|
||||
const personId = req.params.id;
|
||||
let result = { success: true, files: [] };
|
||||
@@ -62,12 +66,16 @@ peopleRouter.post('/:id/media', upload, async (req, res) => {
|
||||
const fileName = profileFile.filename;
|
||||
|
||||
// Generate preview for profile picture
|
||||
const previewPath = await mediaOptimizerService.doGeneratePreview('people', 'profiles', fileName);
|
||||
const previewPath = await mediaOptimizerService.doGeneratePreview(
|
||||
"people",
|
||||
"profiles",
|
||||
fileName,
|
||||
);
|
||||
|
||||
result.files.push({
|
||||
type: 'profile',
|
||||
type: "profile",
|
||||
original: fileName,
|
||||
preview: previewPath ? path.basename(previewPath) : null
|
||||
preview: previewPath ? path.basename(previewPath) : null,
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user