Skip to content

feat(ZDFmediathek): show current title, cover and add settings#10913

Merged
Bas950 merged 2 commits into
PreMiD:mainfrom
FlashSkyNews:zdfmediathek-update
Jul 1, 2026
Merged

feat(ZDFmediathek): show current title, cover and add settings#10913
Bas950 merged 2 commits into
PreMiD:mainfrom
FlashSkyNews:zdfmediathek-update

Conversation

@FlashSkyNews

Copy link
Copy Markdown
Contributor

Description

Reworks the ZDFmediathek activity for the current (Svelte-based) ZDF site. The redesign of zdf.de (/play/…, /dokus/…) broke the old breadcrumb-based selectors, so the activity showed essentially nothing on video-on-demand pages.

Watching

  • Shows the playing video's title, series and parsed info (episode, genre, year, broadcaster) with the cover art as the large image.
  • Anchored on stable selectors (og: meta tags, .zdfplayer-* player classes) instead of the build-hashed Svelte class names, which change on every deploy.
  • Caches the player overlay (series / episode / info line) per URL, so the details persist while the controls overlay is hidden during playback.
  • Detects live streams via the media duration instead of the URL path (live now also plays via /play/ URLs).
  • Reuses the existing broadcaster assets (ZDF, 3sat, ZDFneo, ZDFinfo, arte, KiKA, phoenix) as the small icon.

Browsing

  • Adds presence for series pages, category landing pages (/dokus, /serien, /filme, /kinder, …), search (/suche) and the live overview (/live-tv).

Settings (new)

Privacy mode · Hide on pause · Cover image · Channel logo as small icon · Timestamps · Buttons · Format strings (%title%, %series%, %episode%, %genre%, %year%) · Status display type.

Version bumped 1.1.12.0.0. No new assets required.

🤖 Generated with Claude Code

Rework the activity for the current (Svelte) ZDF site, whose redesign
broke the old breadcrumb-based selectors:

- Show the playing video's title, series and parsed info (episode,
  genre, year, broadcaster) with cover art as the large image.
- Anchor on stable selectors (og: meta, .zdfplayer-* classes) and cache
  the player overlay per URL so details persist during playback.
- Detect live streams via the media duration instead of the URL path.
- Add browsing presence for series, category, search and live pages.
- Add settings: privacy mode, hide on pause, cover image, channel logo
  as small icon, timestamps, buttons, format strings and status display.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings June 18, 2026 17:02
@dimerp

dimerp Bot commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

🖼️ Activity asset preview

Asset inspection complete. No pixels were harmed in the making of this comment. 🤖

ZDFmediathek (websites/Z/ZDFmediathek) — update

Preview Source URL
logo https://cdn.rcd.gg/PreMiD/websites/Z/ZDFmediathek/assets/logo.png
thumbnail https://cdn.rcd.gg/PreMiD/websites/Z/ZDFmediathek/assets/thumbnail.jpg
code (presence.ts) https://cdn.rcd.gg/PreMiD/websites/Z/ZDFmediathek/assets/0.png
code (presence.ts) https://cdn.rcd.gg/PreMiD/websites/Z/ZDFmediathek/assets/1.png
code (presence.ts) https://cdn.rcd.gg/PreMiD/websites/Z/ZDFmediathek/assets/2.png
code (presence.ts) https://cdn.rcd.gg/PreMiD/websites/Z/ZDFmediathek/assets/3.png
code (presence.ts) https://cdn.rcd.gg/PreMiD/websites/Z/ZDFmediathek/assets/4.png
code (presence.ts) https://cdn.rcd.gg/PreMiD/websites/Z/ZDFmediathek/assets/5.png
code (presence.ts) https://cdn.rcd.gg/PreMiD/websites/Z/ZDFmediathek/assets/6.png

Beep boop — I refresh this comment on every push, so no need to scroll. 🤖

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Reworks the ZDFmediathek presence to support the redesigned (Svelte-based) zdf.de player pages by switching to more stable selectors, improving playback detection, and expanding browsing coverage. It also introduces a configurable settings surface (privacy, timestamps, buttons, formatting, and status display options) and bumps the activity version to 2.0.0.

Changes:

  • Replaced brittle breadcrumb/selectors with og:* meta tags and .zdfplayer-* player classes; added per-URL overlay info caching and richer video parsing.
  • Added presence states for non-playback pages (home, search, live overview, series/category pages).
  • Added a comprehensive settings block (privacy, hide-on-pause, cover/channel icons, timestamps/buttons, format strings, status display type) and bumped version 1.1.12.0.0.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
websites/Z/ZDFmediathek/presence.ts Rebuilds activity detection/rendering for the new ZDF player, adds overlay caching, live detection, browsing states, and wiring for new settings.
websites/Z/ZDFmediathek/metadata.json Bumps version and adds new user-configurable settings for privacy/formatting/display behavior.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +190 to +192
const hasMedia = !!video && !Number.isNaN(video.duration)
const live = !!video && !Number.isFinite(video.duration)

Comment on lines +276 to +287
// Privacy mode: only reveal that the user is on ZDFmediathek.
if (privacy) {
presenceData.details = localized.browsing
delete presenceData.state
delete presenceData.smallImageKey
delete presenceData.smallImageText
delete presenceData.largeImageText
delete presenceData.buttons
delete presenceData.endTimestamp
presenceData.largeImageKey = ActivityAssets.Logo
presenceData.startTimestamp = browsingTimestamp
}
Comment thread websites/Z/ZDFmediathek/presence.ts Fixed
@FlashSkyNews

Copy link
Copy Markdown
Contributor Author

I wanted to extend the existing one because I was watching a documentary and thought making it similar to the YouTube one made by y’all would be cool. :) I used Opus 4.8, as you can see. 🫡 I gave Claude access to an isolated Chrome instance and later tested it on Firefox/Zen Browser.

image

- Gate live detection behind hasMedia so a still-loading NaN duration is
  not briefly reported as a livestream.
- Reset the activity name in privacy mode to avoid leaking the title via
  StatusDisplayType.Name.
- Use a non-capturing group in the info-line genre regex (ESLint).
- Replace the deprecated no-arg setActivity() with clearActivity().

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@Bas950
Bas950 enabled auto-merge (squash) July 1, 2026 07:39
@Bas950
Bas950 requested a review from skullysmods July 1, 2026 07:39
@Bas950
Bas950 merged commit 80a2c99 into PreMiD:main Jul 1, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

5 participants