Add watch status for TV series with UI and auto-fix
Added watch_status column to Entry model (plan_to_watch/watching/completed/ on_hold/dropped). Status pill on entry details page opens selection dialog. Set Status in quick actions menu and EntryCard dropdown (TV only). Status filter in Library filter popover. Maintenance auto-fix endpoint that sets statuses based on watched episodes (excl. season 0).
This commit is contained in:
1 parent
a5659cf4c8
commit
cdbaedd7d0
11 files changed
+663
-286
No files matched your search
@@ -1,9 +1,9 @@
|
||||
const EntryRating = require("../models/EntryRating");
|
||||
const collectionManager = require("../services/collectionManager");
|
||||
const entryManager = require("../services/entryManager");
|
||||
const entryService = require("../services/entryService");
|
||||
const tmdbService = require("../services/tmdbService");
|
||||
const asyncWrapper = require("../utils/asyncWrapper");
|
||||
const EntryRating = require('../models/EntryRating');
|
||||
const collectionManager = require('../services/collectionManager');
|
||||
const entryManager = require('../services/entryManager');
|
||||
const entryService = require('../services/entryService');
|
||||
const tmdbService = require('../services/tmdbService');
|
||||
const asyncWrapper = require('../utils/asyncWrapper');
|
||||
|
||||
const _collectionManager = collectionManager;
|
||||
const _entryManager = entryManager;
|
||||
@@ -105,7 +105,7 @@ class EntryController {
|
||||
const seasons = await _entryService.getEntrySeasons(id);
|
||||
|
||||
if (seasons.length == 0) {
|
||||
res.status(204).json({ message: "Provided entry has no seasons" });
|
||||
return res.status(204).json({ message: 'Provided entry has no seasons' });
|
||||
}
|
||||
|
||||
res.status(200).json(seasons);
|
||||
@@ -145,7 +145,7 @@ class EntryController {
|
||||
const { page } = req.query;
|
||||
const data = await tmdbService.fetchTrending(type, page || 1);
|
||||
if (!data)
|
||||
return res.status(500).json({ message: "Failed to fetch trending data" });
|
||||
return res.status(500).json({ message: 'Failed to fetch trending data' });
|
||||
res.status(200).json(data);
|
||||
});
|
||||
|
||||
@@ -155,7 +155,7 @@ class EntryController {
|
||||
const { page } = req.query;
|
||||
const data = await tmdbService.fetchPopular(type, page || 1);
|
||||
if (!data)
|
||||
return res.status(500).json({ message: "Failed to fetch popular data" });
|
||||
return res.status(500).json({ message: 'Failed to fetch popular data' });
|
||||
res.status(200).json(data);
|
||||
});
|
||||
|
||||
@@ -163,10 +163,10 @@ class EntryController {
|
||||
getTmdbSearch = asyncWrapper(async (req, res) => {
|
||||
const { query, page } = req.query;
|
||||
if (!query)
|
||||
return res.status(400).json({ message: "Query parameter is required" });
|
||||
return res.status(400).json({ message: 'Query parameter is required' });
|
||||
const data = await tmdbService.searchMulti(query, page || 1);
|
||||
if (!data)
|
||||
return res.status(500).json({ message: "Failed to search TMDB" });
|
||||
return res.status(500).json({ message: 'Failed to search TMDB' });
|
||||
res.status(200).json(data);
|
||||
});
|
||||
|
||||
@@ -178,7 +178,7 @@ class EntryController {
|
||||
if (!data)
|
||||
return res
|
||||
.status(500)
|
||||
.json({ message: "Failed to fetch top rated data" });
|
||||
.json({ message: 'Failed to fetch top rated data' });
|
||||
res.status(200).json(data);
|
||||
});
|
||||
|
||||
@@ -187,17 +187,17 @@ class EntryController {
|
||||
const { page } = req.query;
|
||||
const data = await tmdbService.fetchUpcoming(page || 1);
|
||||
if (!data)
|
||||
return res.status(500).json({ message: "Failed to fetch upcoming data" });
|
||||
return res.status(500).json({ message: 'Failed to fetch upcoming data' });
|
||||
res.status(200).json(data);
|
||||
});
|
||||
|
||||
// * GET - TMDB PREVIEW (fetch details without saving to library)
|
||||
getTmdbPreview = asyncWrapper(async (req, res) => {
|
||||
const { type, tmdbId } = req.params;
|
||||
const is_tvserie = type === "tv";
|
||||
const is_tvserie = type === 'tv';
|
||||
const data = await tmdbService.fetchEntryData(tmdbId, is_tvserie);
|
||||
if (!data)
|
||||
return res.status(404).json({ message: "Entry not found on TMDB" });
|
||||
return res.status(404).json({ message: 'Entry not found on TMDB' });
|
||||
|
||||
// Fetch credits in parallel
|
||||
const creditsData = await tmdbService.fetchEntryCredits(tmdbId, is_tvserie);
|
||||
@@ -208,7 +208,7 @@ class EntryController {
|
||||
for (const c of creditsData.cast) {
|
||||
credits.push({
|
||||
id: c.credit_id || c.id,
|
||||
cast_type: "cast",
|
||||
cast_type: 'cast',
|
||||
character: is_tvserie
|
||||
? c.roles?.[0]?.character || c.character || null
|
||||
: c.character || null,
|
||||
|
||||
Reference in new issue
Block a user