Major rework of media handelling, and collections

This commit is contained in:
X4Lo committed 2024-09-13 21:27:01 +01:00
1 parent b42e055691
commit f7cb2bed53
37 files changed
+1120 -411

No files matched your search

+9 -9
View File
@@ -4,7 +4,7 @@ const Entry = require('../models/Entry')
const EntryId = require('../models/EntryId')
const EntryRating = require('../models/EntryRating')
const EntrySeen = require('../models/EntrySeen');
const UserCollection = require('../models/UserCollection');
const UserCollection = require('../models/Collection');
const UserCollectionEntry = require('../models/UserCollectionEntry');
const Season = require('../models/Season');
const Episode = require('../models/Episode');
@@ -92,14 +92,14 @@ UserCollectionEntry.afterDestroy(async (instance, options) => {
// ? updating collection poster
// ? remove the poster if the collection is empty now
if (collectionsEntries.length == 0) {
updates.poster = null;
} else {
// ? replace poster it belonged to the removed entry
// if (userCollection.poster_path == entry.poster_path) {
// updates.poster_path = collectionsEntries[0].entry.poster_path;
// }
}
// if (collectionsEntries.length == 0) {
// updates.poster = null;
// } else {
// // ? replace poster it belonged to the removed entry
// // if (userCollection.poster_path == entry.poster_path) {
// // updates.poster_path = collectionsEntries[0].entry.poster_path;
// // }
// }
// ? updating order, only if the removed entry isn't placed at the end
let order = instance.order;