Add history page with list, timeline and year in review
- Backend: /history/years and /history/:year return every movie and episode watch in a year, with entry posters, genres, networks and buddies - History tab: watches by month and day, back-to-back episodes grouped - Timeline tab: latest to oldest, month dividers, stacked binge sessions - Year in Review tab: hours, top shows and genres, streaks, busiest day, biggest binge, monthly and weekday charts, buddies and new shows - Year picker, movies/TV filter, state kept in the URL; unknown-date watches badged and excluded from the review by default - History link in the sidebar and command palette
This commit is contained in:
1 parent
c4aa0488d4
commit
760afd8e84
13 files changed
+1724
No files matched your search
@@ -0,0 +1,24 @@
|
||||
const express = require("express");
|
||||
const historyRouter = express.Router();
|
||||
|
||||
const historyService = require("../services/historyService");
|
||||
const asyncWrapper = require("../utils/asyncWrapper");
|
||||
|
||||
// ! /history
|
||||
// * GET - Years that have watches, with movie/episode counts
|
||||
historyRouter.get(
|
||||
"/years",
|
||||
asyncWrapper(async (req, res) => {
|
||||
res.status(200).json(await historyService.getYears());
|
||||
}),
|
||||
);
|
||||
|
||||
// * GET - Every movie/episode watch in a year (newest first)
|
||||
historyRouter.get(
|
||||
"/:year",
|
||||
asyncWrapper(async (req, res) => {
|
||||
res.status(200).json(await historyService.getYear(req.params.year));
|
||||
}),
|
||||
);
|
||||
|
||||
module.exports = historyRouter;
|
||||
Reference in new issue
Block a user