Commit Graph
136 Commits
Author SHA1 Message Date
4grayandClaude Fable 5 dc05a2566e feat(tmdb): opt-in TMDB metadata enrichment for Xtream and Stalker portals (#1123)
* feat(tmdb): opt-in TMDB metadata enrichment for Xtream and Stalker portals

Adds an opt-in TMDB integration (Settings > Metadata) that enriches
detail views with a field-level merge — the provider stays authoritative
for stream data, TMDB fills editorial fields when the match is confident.

Enrichment:
- Movie/series details: plot, cast (avatar chips), director, genres,
  rating, poster/backdrop, official YouTube trailers
- Confidence-gated matching: provider tmdb_id trusted; otherwise
  normalized-title search with year gate (±1; series accept earlier
  premieres), season-suffix stripping, Cyrillic search-language override,
  and language-prefix fallback variants
- Lazy season/episode enrichment: real episode names, overviews, stills
- "Similar" rail (Xtream): TMDB recommendations matched to the catalog
- Actor pages per portal with full filmography, availability filter and
  an Electron-only "All portals" scope backed by a batched DB_MATCH_TITLES
  worker op over the trigram FTS index

Infrastructure:
- SQLite cache table tmdb_metadata (details, search verdicts, seasons,
  persons; per-language, TTL-guarded), in-memory fallback for the PWA
- Settings: enable toggle, own-API-key override with a live "check key"
  button; TMDB attribution in Settings and About
- Embedded key stays an empty placeholder; CI injects TMDB_API_KEY via
  tools/tmdb/inject-tmdb-key.mjs when the secret is configured
- normalizeTitle shared between renderer and DB worker
- CSP: allow YouTube embeds (frame-src was 'none'; trailers never worked)

Fixes and refactors along the way:
- fix(stalker): Advanced Search sent bare get_ordered_list requests and
  skipped the auth handshake when isFullStalkerPortal was missing on the
  active-playlist meta — full portals answered "Authorization failed."
  and search looked empty; now mirrors the catalog request shape and
  routes through makeAuthenticatedRequest with URL-based detection
- fix(stalker): TMDB fields survive info re-normalization; detail views
  prefer the store copy patched by async enrichment over stale snapshots
- refactor(xtream): split oversized vod/serial detail components into
  component-scoped playback services; detail routes re-initialize on
  route param changes (router reuses them for detail-to-detail nav)
- i18n: all new keys translated across the 18 locales

Docs: docs/architecture/tmdb-metadata-enrichment.md + CLAUDE.md updates.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* fix(tmdb): provide route params observable to inline collection details, linearize regexes

The global-collection inline detail host builds a fake ActivatedRoute for
VodDetailsRouteComponent/SerialDetailsComponent with only snapshot.params.
Since the detail components now read route.params via toSignal() (detail->
detail re-init), the missing observable crashed component construction and
the content hero never rendered — broke dashboard-activation, favorites and
recent Electron E2E on all platforms. Provide the params observable
alongside the snapshot and assert it in the component spec.

Also resolves both CodeQL js/polynomial-redos alerts: bracket-stripping in
normalizeTitle now excludes opening delimiters inside the classes, and
youtubeEmbedUrl extracts watch?v= ids with a linear two-pass match instead
of "watch\?.*v=". Combining-diacritics range rewritten as explicit \u
escapes (greptile note).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* fix(tmdb): surface TMDB-only VOD score in the rating badge, drop youtube.com from CSP

Review follow-ups on PR #1123: the Xtream VOD detail badge renders
rating_imdb, but the merge wrote the TMDB score only into `rating`, so a
TMDB-only score was never displayed (Codex P2) — fill rating_imdb when the
provider left it empty, mirroring the Stalker merge. All trailer iframes
are normalized to youtube-nocookie.com, so the extra youtube.com frame-src
allowance was dead surface (greptile) — removed.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* fix(tmdb): resolve confirmed review findings — matching correctness, race guards, cache schema

Fixes the confirmed findings from the PR #1123 code review:

- Stalker search: setSelectedContentType now runs BEFORE setSelectedItem,
  so the TMDB enrichment gate in the selection hook no longer sees the
  content type of the previously open tab (wrong/no enrichment after
  ITV -> search -> movie).
- Title normalization is now two-tier (normalizeTitleKeys): the exact
  normalized form keeps a trailing year, the base form strips it and
  remembers the tag. Year stripping is anchored to the end of the title
  ("2001: A Space Odyssey" keeps its year) and language-prefix stripping
  is UPPERCASE-only ("It: Chapter Two" is no longer amputated).
- All catalog matching (similar rail, actor pages, DB worker
  DB_MATCH_TITLES) compares exact forms first and only accepts
  year-stripped matches when the stripped tag is year-compatible (+-1)
  with the TMDB year — "Blade Runner" (1982) can no longer claim a
  catalog "Blade Runner 2049". CatalogTitleMatch carries the stripped
  trailingYear so the renderer can apply the guard to worker matches.
- mergedBackdrops tolerates a plain-string backdrop_path; enrichment
  merge+patch blocks are wrapped in try/catch so a malformed provider
  payload can no longer become an unhandled rejection.
- loadGlobalMatches (both actor routes) guards against actor->actor
  navigation races — a slow match for the previous person no longer
  overwrites the current one's results.
- tmdb_metadata media_type CHECK widened to ('movie','tv','person') and
  person rows now use the honest 'person' type (TmdbCacheMediaType).
  Pre-release dev DBs with the narrow CHECK are rebuilt in place — the
  table is a pure cache, so the migration is a self-healing
  drop-and-recreate keyed off sqlite_master.

Docs updated (tmdb-metadata-enrichment.md, CLAUDE.md). New regression
coverage: title-normalization.util.spec.ts, two-tier cases in
tmdb-similar.util.spec.ts and title-match.operations.spec.ts.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-07-04 17:07:46 +02:00
4grayandClaude Fable 5 e14b8ae8d9 feat(ci): enforce lint, guard coverage policy, add max-lines rule (#1117)
* fix(lint): resolve module-boundary and prefer-inject errors

Retag workspace-shell-util as type:data-access to match its injectable
services that depend on @iptvnator/services, and convert
RemoteControlService to inject(HttpClient).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* feat(lint): enforce max-lines 400 with generated baseline

Add a max-lines ESLint error (hard cap 400 raw lines per TypeScript
file) per the repo file-size rule. The 134 pre-existing offenders are
baselined in tools/eslint/max-lines-baseline.mjs, regenerable via
generate-max-lines-baseline.mjs; the list should only shrink.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* feat(ci): enforce lint on PRs and guard coverage policy drift

- Add a Lint job to ci.yml running nx run-many -t lint --all, so
  module-boundary tags, legacy-alias bans, and max-lines gate merges.
- Fix the root lint script (was linting only electron-backend).
- Add tools/coverage/check-coverage-policy.mjs: fails CI when a project
  with a test target is missing from coverage-policy.json; wired into
  coverage:ci as coverage:policy:check.
- Run Tier B/C unit tests in CI without coverage (list derived from the
  policy), so website/packaging/remote-control tests run on PRs.
- Replace the hand-picked 16-project test:unit:ci list with --all.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* docs: document CI lint enforcement and coverage policy guard

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* fix(ci): address bot review feedback on policy guard and baseline generator

- Drive Tier B/C validation from each policy entry's validationCommand
  (falling back to nx test), skipping projects with an e2e target since
  the E2E workflow already runs them (Codex).
- Fail when a Tier A entry has no test target (Greptile, adapted:
  checking all entries against test targets would false-positive on the
  intentionally spec-less e2e/mock-server tiers).
- Guard against missing JSON array in nx show projects output (Greptile).
- Scan .tsx files in the max-lines baseline generator to match the
  ESLint rule's file patterns (Greptile).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-07-04 10:06:45 +02:00
4gray b1119189e2 feat(updater): add GitHub releases desktop updater
Adds the GitHub Releases desktop updater with release notes, startup notification, packaging metadata, tests, and CI fixes for Electron E2E.
2026-06-28 22:21:20 +02:00
4gray 1073ce5350 ci(electron): require embedded mpv in windows artifacts 2026-06-14 22:09:31 +02:00
4gray 4094a36fef Harden Linux embedded MPV packaging (#1043) 2026-06-13 17:24:13 +02:00
4grayand4gray 7775553a6b ci: skip draft release for fork PRs
Co-authored-by: 4gray <fourgray@proton.me>
2026-06-12 15:02:42 +02:00
4grayand4gray e2a7b5364f test(electron): allow local EPG mocks in E2E
Co-authored-by: 4gray <fourgray@proton.me>
2026-06-12 14:23:36 +02:00
4gray 06700b318a feat(electron): add embedded mpv support for windows and linux (#1031)
Adds experimental embedded MPV support for Windows and Linux, expands packaging/runtime validation, and updates CI coverage for the cross-platform native addon.
2026-06-09 08:58:38 +02:00
4grayand4gray ef900d0f2a [codex] Add scoped coverage reporting (#1024)
* add scoped coverage reporting

* fix coverage review feedback

---------

Co-authored-by: 4gray <fourgray@proton.me>
2026-06-06 17:41:40 +02:00
4gray f3c0cd3820 ci: clarify embedded mpv cache inputs 2026-05-22 02:16:32 +03:00
4gray 0b19155469 ci: cache embedded mpv runtime 2026-05-22 02:02:06 +03:00
4gray 5d31c1d49a ci(docker): publish images after trusted events 2026-05-21 09:37:43 +02:00
4gray 2d5c4fa4f9 chore: tighten validation and runtime logging
* chore: tighten validation and runtime logging

* fix(i18n): localize new settings labels
2026-05-15 17:43:42 +02:00
4gray 31bddbd70f ci: build embedded mpv artifacts on master
Entire-Checkpoint: 5b514fe72836
2026-05-02 09:02:05 +02:00
4gray 6aa4f2521b build(embedded-mpv): enhance macOS build process and validation for embedded MPV integration
Entire-Checkpoint: c6e522b4276c
2026-04-27 11:06:12 +02:00
4gray 0b5089853f ci(build): adjust conditions for macOS Embedded MPV artifact in CI workflow
Entire-Checkpoint: c6e522b4276c
2026-04-27 00:46:54 +02:00
4gray 9f873e6bed feat(player): add embedded-mpv player for macOS as experimental feature
- Introduced tooling for building and staging the macOS `libmpv` runtime for IPTVnator's embedded MPV player.
- Added `build-macos-runtime.mjs` for building an LGPL-compatible runtime from source.
- Created `stage-macos-runtime.mjs` for staging the built runtime artifacts.
- Implemented validation for the packaged embedded MPV runtime in `electron-after-pack.cjs` and `embedded-mpv-macos.cjs`.
- Updated packaging scripts to ensure the embedded MPV runtime is correctly integrated and validated during the build process.
- Added README files to document the expected layout and usage for the embedded MPV runtime artifacts.

Entire-Checkpoint: c6e522b4276c
2026-04-27 00:32:14 +02:00
4gray d90a0a8f89 build: update CI configuration for Linux packaging targets and profiles 2026-04-13 08:46:14 +02:00
4gray b449e3796b build: update Snap packaging to use core22 base for compatibility 2026-04-13 08:06:48 +02:00
4gray f39a51895e ci(flatpak): enhance Flatpak validation checks for metainfo and launcher integrity
Entire-Checkpoint: 21b9b9f90f23
2026-04-12 12:44:22 +02:00
4gray 1136e9abac ci(flatpak): add Flatpak support with metainfo and asset validation
Entire-Checkpoint: 21b9b9f90f23
2026-04-12 12:13:05 +02:00
4gray e0b3c74fed ci(packaging): implement Linux launcher sandbox fix and verification process
Entire-Checkpoint: 21b9b9f90f23
2026-04-12 11:47:07 +02:00
4gray 2bfa557438 ci(workflow): add verification step for packaged worker layout 2026-03-28 21:41:24 +01:00
4gray 48c6567971 feat(ci): add CI workflow for unit tests and typechecks 2026-03-28 15:48:24 +01:00
4gray 81c2aab829 test(e2e): add end-to-end tests for playlist import, providers, and settings persistence
- Implemented tests for importing M3U playlists via native dialog.
- Added smoke tests for loading Xtream and Stalker content through IPC.
- Created tests to verify persistence of remote control settings across app restarts.
- Updated smoke tests to check for main window properties and workspace content rendering.

refactor(electron-backend): enhance store service and database path handling

- Modified store service to use a dynamic configuration directory based on environment.
- Refactored database connection to utilize new path utility functions for better path management.

fix(e2e): improve test selectors and structure for better reliability

- Updated test selectors in web-e2e tests to use role-based queries for better accessibility.
- Refactored settings tests to reduce redundancy and improve clarity.

chore(e2e): update TypeScript configuration for better inclusion of test files

- Adjusted tsconfig.json to ensure proper inclusion of e2e test files.

Entire-Checkpoint: bb9a8e2e351e
2026-03-17 23:30:16 +01:00
4gray 367c9507a5 ci(macOS): enhance code signing process with CSC_NAME variable and verification steps 2026-03-15 10:55:30 +01:00
4gray ec84eea924 feat(macOS): add notarization support and entitlements for Electron app 2026-03-13 07:36:09 +01:00
4gray 0b05c07462 chore: remove pnpm version specification in workflows 2026-02-19 23:13:07 +01:00
4gray 61d34aef7a chore: switch to pnpm 2026-02-19 23:08:36 +01:00
4grayandClaude Opus 4.6 3dc3794ac2 feat(website): add Astro landing page and blog with cinematic broadcast design
Create a new IPTVnator website using Astro 5 + Tailwind CSS within the Nx monorepo.
Features include a landing page with hero section, feature grid with auto-scrolling
carousel, screenshot showcase, download CTA, blog with MDX content collections,
and a GitHub Pages deployment workflow. Design uses a cinematic broadcast aesthetic
with TV-effect hover animations, Playfair Display serif typography, and warm dark
surfaces. Also fixes .gitignore to cover nested node_modules directories.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Entire-Checkpoint: 8171359f42f3
2026-02-14 19:47:47 +01:00
4gray 6640753bec fix: ensure dependencies are installed without frozen lockfile in E2E tests 2026-02-08 09:50:19 +01:00
4gray 4979d3f876 fix(ci): enable tag-based Snap publish and remove trailing spaces 2026-01-13 22:55:32 +01:00
4gray 96e2a57d0c ci: run workflows on master branch instead of nx
Update GitHub Actions workflow triggers to use the master branch
for push and pull_request events. Replace the previous nx branch
restriction so CI (build, make and e2e tests) runs on master and tag
events as intended.

This enables workflows to execute for changes merged to master and
aligns branch configuration across workflows.
2026-01-12 21:58:29 +01:00
4gray 6cd0c1fa66 feat(ci): add cross-platform E2E workflow and remove old CI
Add a new GitHub Actions workflow "Cross-Platform E2E Tests" that runs
end-to-end tests on linux, macOS, and Windows using a matrix job.
The workflow checks out code, sets up Node.js 22 with npm cache,
installs deps, builds the backend, installs Playwright browsers, and
runs the electron-backend-e2e suite (using xvfb on Linux). Failed
test artifacts (Playwright report) are uploaded per OS for 7 days.

Remove the previous monolithic 'Build and Test' workflow which included
unit tests, coverage upload, and an older E2E configuration. This
consolidates E2E across platforms into a focused, cross-platform job
and simplifies the CI surface by deprecating the outdated workflow.
2026-01-09 12:54:05 +01:00
4gray 54b8d3a18b ci: move env variable to step header 2025-12-14 13:03:13 +01:00
4gray d7bfd2648c feat(ci): add GitHub Action job to publish Snap on tags
Add a publish-snap job to the CI workflow that runs after build and
only triggers for version tags (refs/tags/v*). The job downloads the
linux build artifacts, installs snapcraft, locates the generated .snap
file and uploads it to the Snapcraft Store releasing to the stable
channel. It validates the presence of a snap file and fails if none is
found.

This enables automated Snap distribution for tagged releases using the
SNAPCRAFT_STORE_CREDENTIALS secret.
2025-12-14 12:31:00 +01:00
4gray 568a5feac3 fix(ci): use different runners for macos arm and intel arch
Update GitHub Actions workflow to support multiple OS runners and CPU
architectures, standardize matrix keys, and adjust platform-specific
steps and artifact names.

- Replace simple os matrix with include entries specifying os, runner,
  and arch to allow macOS x64/arm64 separation and explicit runners for
  linux/windows.
- Use runner matrix value for runs-on and change timeout/strategy
  accordingly.
- Adjust conditional checks to use normalized os values (linux, macos,
  windows) rather than platform-specific runner labels.
- Install Linux system deps only when os == 'linux' and keep Flatpak
  setup for electron-builder.
- Add a macOS-specific make step that passes the architecture to the
  electron make command, while keeping a combined make step for
  non-macOS builds.
- Upload macOS artifacts per architecture and rename artifact paths to
  include arch; update release files list to include both macOS x64 and
  arm64 artifact patterns.

These changes enable reliable, architecture-aware macOS builds,
prevent native module conflicts across runners, and ensure artifacts
are labeled and uploaded correctly.
2025-12-12 22:22:31 +01:00
4gray 4020de1af9 ci: enhance build workflow with Flatpak setup
Added Flatpak configuration steps to the build workflow.
2025-11-26 17:28:28 +01:00
4gray ae6e97db91 ci: install Linux dependencies in CI workflow
Added steps to install Linux system dependencies for builds.
2025-11-26 17:12:39 +01:00
4gray 12a513802a fix(electron): simplify production load and CI frontend build
Remove unused url.format import and switch from loadURL with a
formatted file: URL to loadFile for production. This simplifies code,
avoids manual file URL construction, and makes the production path
loading more robust.
Also update CI job to build the frontend via the NX command
(npx nx build web --skip-nx-cache) instead of npm run build:frontend,
aligning the workflow with the monorepo's canonical build command.
2025-11-23 19:14:01 +01:00
4gray fbed100fb0 ci: make release step create draft prereleases for PRs
Update the GitHub release action to mark releases from pull 
request events as prerelease and to set a safe tag name when the
 is not triggered by a tag ref.

- Set prerelease to true when github.event_name == 'pull_request'
  so draft releases created during PR workflows are marked as
  prereleases.
- Use the tag name from github.ref_name when the workflow is
  triggered by a tag; otherwise generate a deterministic test tag
  "test-<sha>" to avoid using an invalid or empty tag name.

This prevents accidental full releases from PR runs and ensures the
action always has a valid tag_name value.
2025-11-08 23:02:15 +01:00
4gray 681e58728f chore(config): normalize YAML quoting and indentation 2025-10-27 08:20:29 +01:00
4gray 6ac61720ad feat(ci): add GitHub Actions workflow to build and make app 2025-10-27 08:20:29 +01:00
4gray 99ed5df404 chore: back to electron + nx 2025-10-07 18:02:13 +02:00
4gray d22121704b chore: update bug report template to reflect migration from Electron to Tauri 2025-03-04 22:06:12 +01:00
4gray ec66c9da4a chore: update GitHub workflows to use master branch and upgrade Node.js version to 22 2025-03-04 22:05:53 +01:00
4gray 04ccc67021 chore: remove Electron build configuration files 2024-12-01 19:49:30 +01:00
4gray 2259e1116c fix: update Dockerfile and GitHub Actions workflow
Update the CMD instruction in the Dockerfile to target 
main.js instead of main-*.js for better specificity. 
Modify the tag and release names in the GitHub Actions 
workflow to follow a consistent naming convention, 
ensuring clarity in versioning.
2024-11-29 23:12:10 +01:00
4gray 537d30ab1e feat(ci): update Docker workflow to include version tagging
Adds a step to install jq and retrieves the version from 
package.json to tag the Docker image. This ensures that the 
Docker image is versioned correctly based on the package 
version, improving traceability and deployment consistency.
2024-11-29 01:13:34 +01:00
4gray 9a7e9ae687 feat(ci): update release naming convention in workflow
Modifies the tagName and releaseName in the Tauri release 
workflow to include platform and arguments for better 
version identification. This change enhances clarity and 
consistency in release management.
2024-11-29 01:13:34 +01:00