Clear-all-filters button + active-filter counters for the cine.ekaii.fr Jellyfin web UI (LinuxServer custom-cont-init.d injection)
  • Shell 53.2%
  • JavaScript 46.8%
Find a file
2026-07-15 01:43:33 +02:00
99-ekaii-clearfilters.sh Initial public release 2026-07-15 01:43:33 +02:00
ekaii-clearfilters.js Initial public release 2026-07-15 01:43:33 +02:00
LICENSE Initial public release 2026-07-15 01:43:33 +02:00
README.md Initial public release 2026-07-15 01:43:33 +02:00

jellyfin-clearfilters

Adds a Clear all filters button and active-filter counters to the Jellyfin library filter panel (cine.ekaii.fr). Pure client-side: no plugin, no fork, no server changes.

What it does

  • A "Clear all filters" button at the top of the filter panel with a live count of currently-active filters. One click unchecks every filter across all sections (Filters, Features, Genres, Parental Ratings, Tags, Years, Status) and the library re-queries through Jellyfin's own change handlers.
  • A count badge on each collapsible section header (e.g. Tags 3), shown even while the section is collapsed, so active filters are visible at a glance.
  • Reload-safe: the script watches the panel's asynchronous population and Jellyfin re-checking saved filters after a reload, so the counts and button stay correct — not just on live toggles.

Targets the classic filterdialog UI (.filterDialog, [is="emby-collapse"], .collapseContent).

Files

  • ekaii-clearfilters.js — the feature, loaded by a <script> tag injected into Jellyfin's index.html. Standalone copy for review/editing.
  • 99-ekaii-clearfilters.sh — self-contained injector with the JS embedded. Writes the JS into the web root and (re)injects a versioned <script> tag. Idempotent and version-aware: strips any prior tag, injects the current VER. Doubles as the LinuxServer custom-cont-init.d hook.

Deployment (cine.ekaii.fr — LinuxServer image, Coolify service id 5)

The web UI lives at /usr/share/jellyfin/web inside the image, so edits are wiped on container recreate. Persistence uses the LinuxServer custom-cont-init.d hook, which re-runs the injector on every container start.

  1. Injector on the NAS host (mode 755): /mnt/services/jellyfin-nas/webmods/99-ekaii-clearfilters.sh

  2. Bind mount added to the Coolify docker_compose_raw (DB) for the jellyfin service — regenerated to disk on every redeploy:

    volumes:
      - '/mnt/services/jellyfin-nas/webmods/99-ekaii-clearfilters.sh:/custom-cont-init.d/99-ekaii-clearfilters.sh:ro'
    

On start the hook logs [ekaii-clearfilters] done. A plain restart keeps the already-injected files; a recreate/redeploy re-applies them via the hook.

Manual apply (no recreate)

docker exec -i jellyfin-<id> bash -s < 99-ekaii-clearfilters.sh

(then hard-reload the browser once — service-worker cache)

Updating

Edit ekaii-clearfilters.js, re-embed it into 99-ekaii-clearfilters.sh, bump VER in the injector (cache-bust), copy to the NAS path, then redeploy or run the manual-apply command above.

Rollback

Remove the bind-mount line from docker_compose_raw and recreate, or for an immediate revert strip the tag:

docker exec jellyfin-<id> sed -i "s#<script defer src='ekaii-clearfilters.js[^']*'></script>##" /usr/share/jellyfin/web/index.html

Notes

  • No server, DB, or Meilisearch changes — only the static web shell.
  • The injector's embedded JS is the deployed source of truth; the standalone ekaii-clearfilters.js is the same code kept separate for review.