trackers: media hub with webtoons, podcasts and videos; shows and anime filters
Deploy production / deploy (push) Successful in 1m22s
Deploy production / deploy (push) Successful in 1m22s
- /trackers/media: one card per child (reading, movies, shows, webtoons, music, podcasts, videos) with quick stats, a combined currently-consuming feed and a mixed watchlist - webtoons, podcasts, videos: new owner-editable trackers on one generic media.items table, JSON import (owner form or scripts/media-run.sh) - shows: /trackers/shows -> /trackers/movies?type=show; anime flag on movies.titles (backfilled, set from TMDB, owner toggle) and ?type=anime filter - nav: media replaces the top-level reading, movies and music entries; their URLs are kept
This commit is contained in:
1 parent
4ef75f9d25
commit
079399635d
33 files changed
+48352
-44
No files matched your search
@@ -2,18 +2,18 @@ import { describe, expect, it } from 'vitest';
|
||||
import { activeGames, pokemonEntryFor, sortedGames, visibleTrackers } from './projects';
|
||||
|
||||
describe('trackers', () => {
|
||||
it('lists tasks, money, reading first for the owner', () => {
|
||||
it('lists tasks, money, media first for the owner', () => {
|
||||
expect(
|
||||
visibleTrackers(true)
|
||||
.map((t) => t.name)
|
||||
.slice(0, 4)
|
||||
).toEqual(['tasks', 'money', 'reading', 'spotting']);
|
||||
).toEqual(['tasks', 'money', 'media', 'spotting']);
|
||||
});
|
||||
it('hides private trackers when logged out', () => {
|
||||
const names = visibleTrackers(false).map((t) => t.name);
|
||||
expect(names).not.toContain('tasks');
|
||||
expect(names).not.toContain('health');
|
||||
expect(names.slice(0, 3)).toEqual(['money', 'reading', 'spotting']);
|
||||
expect(names.slice(0, 3)).toEqual(['money', 'media', 'spotting']);
|
||||
});
|
||||
it('uses short single-word names', () => {
|
||||
for (const t of visibleTrackers(true)) expect(t.name).toMatch(/^[a-z]+$/);
|
||||
@@ -26,7 +26,29 @@ describe('trackers', () => {
|
||||
expect(t.subtitle).not.toMatch(/^private:/);
|
||||
}
|
||||
expect(owner.find((t) => t.name === 'money')?.locked).toBe(true);
|
||||
expect(owner.find((t) => t.name === 'reading')?.locked).toBeUndefined();
|
||||
expect(owner.find((t) => t.name === 'media')?.locked).toBeUndefined();
|
||||
});
|
||||
it('nests reading, movies, shows, webtoons, music, podcasts and videos under media', () => {
|
||||
const media = visibleTrackers(false).find((t) => t.name === 'media')!;
|
||||
expect(media.href).toBe('/trackers/media');
|
||||
expect(media.children!.map((c) => c.name)).toEqual([
|
||||
'reading',
|
||||
'movies',
|
||||
'shows',
|
||||
'webtoons',
|
||||
'music',
|
||||
'podcasts',
|
||||
'videos'
|
||||
]);
|
||||
expect(media.children!.find((c) => c.name === 'music')!.href).toBe('/trackers/music');
|
||||
const top = visibleTrackers(true).map((t) => t.name);
|
||||
for (const n of ['reading', 'movies', 'music']) expect(top).not.toContain(n);
|
||||
});
|
||||
it('locks movies and shows inside media when the movies tracker is private', () => {
|
||||
const pub = visibleTrackers(false, [], ['movies', 'shows']).find((t) => t.name === 'media')!;
|
||||
expect(pub.children!.map((c) => c.name)).not.toContain('movies');
|
||||
const own = visibleTrackers(true, [], ['movies', 'shows']).find((t) => t.name === 'media')!;
|
||||
expect(own.children!.find((c) => c.name === 'shows')?.locked).toBe(true);
|
||||
});
|
||||
it('splits games into active first and non-active (flagged) after', () => {
|
||||
const off = ['lol', 'black-ops', 'pokemon-x-y'];
|
||||
|
||||
Reference in new issue
Block a user