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
@@ -15,7 +15,6 @@ const _mediaDownloaderService = mediaDownloaderService;
|
||||
const _mediaOptimizerService = mediaOptimizerService;
|
||||
|
||||
class PeopleManager {
|
||||
|
||||
constructor() {
|
||||
if (!PeopleManager.instance) {
|
||||
PeopleManager.instance = this;
|
||||
@@ -36,7 +35,9 @@ class PeopleManager {
|
||||
// * 3 - fetch person data from TMDB
|
||||
const personData = await fetchPersonDetails(person.tmdb_id);
|
||||
if (!personData) {
|
||||
throw new InternalServerError(`Couldn't fetch data from TMDB for person with ID: ${id}`);
|
||||
throw new InternalServerError(
|
||||
`Couldn't fetch data from TMDB for person with ID: ${id}`,
|
||||
);
|
||||
}
|
||||
|
||||
// * 4 - update person with fetched data
|
||||
@@ -50,25 +51,29 @@ class PeopleManager {
|
||||
// * 5 - download person media
|
||||
// TODO: peopleManage: update the person media each year
|
||||
if (!person.medias || person.medias.length === 0) {
|
||||
const downloadedImages = await _mediaDownloaderService.downloadPersonMedia(person);
|
||||
const downloadedImages =
|
||||
await _mediaDownloaderService.downloadPersonMedia(person);
|
||||
for (const image of downloadedImages) {
|
||||
// ? generating preview
|
||||
_mediaOptimizerService.doGeneratePreview('peoples', image.type + 's', image.path).then((result) => {
|
||||
const msg = `People Service | Generated Person Preview`;
|
||||
logToFile(msg);
|
||||
}).catch((err) => {
|
||||
const msg = `People Service | Error Generating Person Preview`;
|
||||
logToFile(msg);
|
||||
logToFile(err);
|
||||
});
|
||||
// ? generating preview
|
||||
_mediaOptimizerService
|
||||
.doGeneratePreview("peoples", image.type + "s", image.path)
|
||||
.then((result) => {
|
||||
const msg = `People Service | Generated Person Preview`;
|
||||
logToFile(msg);
|
||||
})
|
||||
.catch((err) => {
|
||||
const msg = `People Service | Error Generating Person Preview`;
|
||||
logToFile(msg);
|
||||
logToFile(err);
|
||||
});
|
||||
// ? inserting data
|
||||
await Media.create({
|
||||
mediaable: 'people',
|
||||
mediaable: "people",
|
||||
mediaableId: person.id,
|
||||
type: image.type,
|
||||
path: image.path,
|
||||
isLocal: true,
|
||||
isSelected: true
|
||||
isSelected: true,
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -76,7 +81,6 @@ class PeopleManager {
|
||||
// * 6 - return the person
|
||||
return await _peopleService.getPersonById(id);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
module.exports = new PeopleManager();
|
||||
module.exports = new PeopleManager();
|
||||
Reference in new issue
Block a user