summaryrefslogtreecommitdiffstats
path: root/packages/meshbay-hub/src/meshbay_hub/static/video-app.js
diff options
context:
space:
mode:
authorChristophe Besson <cbesson@gmail.com>2026-08-26 17:18:37 +0200
committerChristophe Besson <cbesson@gmail.com>2026-08-26 17:18:37 +0200
commit80cb6c4dc5f22336387f2ac74ef2cb85cf2cf7d4 (patch)
tree590e2daf81b2feef674f1bd580b9bf40f83addad /packages/meshbay-hub/src/meshbay_hub/static/video-app.js
parentca62b4123b854fc9ece258e14c84c895aaa275cd (diff)
parent59289b82dc8af08c605fd247c90a5c5ec92c6db3 (diff)
downloadmeshbay-80cb6c4dc5f22336387f2ac74ef2cb85cf2cf7d4.tar.gz
Merge branch 'feat/video-type-filter'
Videos app grouping and TMDB matching fixes, plus a new toolbar filter: - A season-like ancestor folder (numbered season, or Specials/Bonus/Extras -> season 0) now names the show from its own root folder, unconditionally — never a per-file guessit title, which cannot tell a show's real name from an individual episode's own one-off name when the filename carries no reliable ShowName/SxxExx structure. Fixes a real show's episodes and Specials folder alike showing up as dozens of individual "movies", each matched against TMDB by its own one-off title. - The ancestor walk continues past every consecutive season-like folder, not just the first — a per-season Bonus folder is nested two levels inside the show, and stopping at the first would name the season as the show. - A season spanning more than one folder (a per-book Bonus folder nested inside every numbered season) no longer hands out colliding episode numbers independently in each one. - guessit's own episode number is not trusted when it comes from a bare 3-digit leading number ("100" parses as season=1/episode=0, not episode=100) — read directly via regex instead. - Recognizes "S1"/"S2"-style abbreviated season folders, not just full words ("Season"/"Saison"/"Livre") — a real show organized its later seasons this way and they never got the ancestor-based grouping fix at all. - The TMDB match cache is no longer trusted across a movie<->show reclassification it doesn't know happened. - New: an All/Movies/Series filter in the Videos toolbar, to the left of the search field, defaulting to "All"; wraps correctly on mobile. Verified live against the real libraries these were found on throughout — not synthetic reproduction alone. 430 hub tests + 667 node tests passing.
Diffstat (limited to 'packages/meshbay-hub/src/meshbay_hub/static/video-app.js')
-rw-r--r--packages/meshbay-hub/src/meshbay_hub/static/video-app.js28
1 files changed, 23 insertions, 5 deletions
diff --git a/packages/meshbay-hub/src/meshbay_hub/static/video-app.js b/packages/meshbay-hub/src/meshbay_hub/static/video-app.js
index ce38b0e..dd120da 100644
--- a/packages/meshbay-hub/src/meshbay_hub/static/video-app.js
+++ b/packages/meshbay-hub/src/meshbay_hub/static/video-app.js
@@ -758,10 +758,14 @@ function VideoApp({
}) {
const [mode, setMode] = useState(loadViewMode);
const [filter, setFilter] = useState('');
+ // Which of movies/shows to show at all — independent of the text filter
+ // below, and applied first: a title match within a type nobody asked to
+ // see is still not what "Movies only" means.
+ const [typeFilter, setTypeFilter] = useState('all');
const tmdbEnabled = tmdbConfig ? tmdbConfig.enabled : true;
useEffect(() => { setMode(loadViewMode()); }, [groupId]);
- useEffect(() => { setFilter(''); }, [groupId]);
+ useEffect(() => { setFilter(''); setTypeFilter('all'); }, [groupId]);
const setModeAndSave = (m) => { setMode(m); saveViewMode(m); };
@@ -769,10 +773,10 @@ function VideoApp({
() => groupVideoEntries(entries, videoRoot), [entries, videoRoot]);
const needle = filter.trim().toLowerCase();
- const filteredMovies = useMemo(() => (!needle ? movies : movies.filter(
- (e) => (e.display_title || e.name).toLowerCase().includes(needle))), [movies, needle]);
- const filteredShows = useMemo(() => (!needle ? shows : shows.filter(
- (s) => s.title.toLowerCase().includes(needle))), [shows, needle]);
+ const filteredMovies = useMemo(() => (typeFilter === 'series' ? [] : !needle ? movies : movies.filter(
+ (e) => (e.display_title || e.name).toLowerCase().includes(needle))), [movies, needle, typeFilter]);
+ const filteredShows = useMemo(() => (typeFilter === 'movies' ? [] : !needle ? shows : shows.filter(
+ (s) => s.title.toLowerCase().includes(needle))), [shows, needle, typeFilter]);
return html`
${(status === 'discovering' || status === 'connecting' || status === 'fetching') && html`
@@ -794,6 +798,20 @@ function VideoApp({
onClick=${() => setModeAndSave('flat')}>
${t('video.mode_flat')}
</button>
+ <div class="tb-typefilter">
+ <button class=${typeFilter === 'all' ? 'active' : ''}
+ onClick=${() => setTypeFilter('all')}>
+ ${t('video.filter_all')}
+ </button>
+ <button class=${typeFilter === 'movies' ? 'active' : ''}
+ onClick=${() => setTypeFilter('movies')}>
+ ${t('video.filter_movies')}
+ </button>
+ <button class=${typeFilter === 'series' ? 'active' : ''}
+ onClick=${() => setTypeFilter('series')}>
+ ${t('video.filter_series')}
+ </button>
+ </div>
<div class="tb-search">
<${Icon} name="search" />
<input type="text" placeholder="${t('group.filter')}"