B: add download of season media + maintenance
This commit is contained in:
1 parent
d799ef2368
commit
534572775f
6 files changed
+76
-16
No files matched your search
@@ -164,7 +164,10 @@ class EntryManager {
|
||||
let existingSeason = await Season.findOne({
|
||||
where: {
|
||||
tmdb_id: season.id
|
||||
}
|
||||
},
|
||||
include: [
|
||||
{ model: Media, as: 'medias' }
|
||||
]
|
||||
});
|
||||
|
||||
// If the season exists, update it; otherwise, create a new season
|
||||
@@ -198,6 +201,9 @@ class EntryManager {
|
||||
});
|
||||
}
|
||||
|
||||
if (existingSeason.medias.length = 0)
|
||||
_mediaManager.getSeasonMedia(existingSeason);
|
||||
|
||||
// * Update or insert episodes for the season
|
||||
for (const episode of seasonData.episodes) {
|
||||
// Fetch existing episode data if it exists
|
||||
|
||||
Reference in new issue
Block a user