Skip to content

fix(images): disambiguate progress overlay cache keys - #17492

Merged
crobibero merged 2 commits into
jellyfin:masterfrom
GOvEy1nw:fix/image-cache-overlay-key
Aug 8, 2026
Merged

crobibero merged 2 commits into
jellyfin:masterfrom
GOvEy1nw:fix/image-cache-overlay-key

Conversation

@GOvEy1nw

@GOvEy1nw GOvEy1nw commented Jul 30, 2026 •

Copy link
Copy Markdown
Contributor

Changes

Fix derivative image cache-key collisions between percent-played and unwatched-count overlays.

Problem

ImageProcessor.GetCacheFilePath serialized both overlay types using the same
p= component. Two otherwise identical transformations with the same numeric
value could therefore produce the same derivative path even though they render
different overlays.

A focused regression test reproduces the collision on current master.

Implementation

  • Serialize percent played with pp=.
  • Serialize unwatched count with uc=.
  • Format percent-played values using invariant culture.
  • Increment transformed-image cache version from 3 to 4.
  • Expose cache-path construction only internally for direct regression tests.

Scope and non-goals

This change does not modify:

  • overlay rendering;
  • HTTP cache headers;
  • image encoding or format negotiation;
  • source-image handling;
  • cache directory layout;
  • cache cleanup behavior.

Validation

Focused baseline against old key behavior:

  • 2 passed, 3 failed, 0 skipped.
  • Expected failures covered overlay-type collision, culture variance, and the
    new cache-version snapshot.

After the fix:

  • Focused cache-path tests: 5 passed, 0 failed, 0 skipped.
  • Jellyfin.Server.Integration.Tests Release: 108 passed, 0 failed, 3 skipped.
  • Full Jellyfin.sln Release gate with XPlat coverage: 3,161 passed, 0 failed,
    10 skipped.
  • dotnet format --verify-no-changes --verbosity minimal: passed.
  • git diff --check: passed.

Tests cover:

  • percent-played and unwatched-count requests produce different paths;
  • different percent-played values produce different paths;
  • different unwatched-count values produce different paths;
  • culture changes do not alter paths;
  • no-overlay serialization remains unchanged except for cache version 4.

No performance benchmark was run because this is a correctness fix. No
performance improvement is claimed.

Compatibility and cache migration

No public API or plugin interface changes.

The version bump causes one-time regeneration of transformed-image cache
entries after upgrade. Existing version-3 entries are no longer reused and
will eventually be removed by the existing daily cache cleanup.

Related work

PR #17420 also touches transformed-image caching but addresses atomic cache
publication and does not overlap this key-serialization fix.

No exact tracking issue was found during overlap searches.

Code assistance

An AI coding agent was used for repository navigation, implementation
assistance, test authoring, validation, and drafting. All changes and command
results were reviewed and verified before submission.

@GOvEy1nw
GOvEy1nw marked this pull request as ready for review July 30, 2026 08:02
@sonarqubecloud

Copy link
Copy Markdown

@jellyfin-bot

Copy link
Copy Markdown
Contributor

Jellyfin API (v 12.0.0)


Result


No differences. Specifications are equivalent

@theguymadmax theguymadmax moved this from Todo to Approved in Jellyfin v12 Aug 6, 2026
@crobibero
crobibero merged commit 2218f29 into jellyfin:master Aug 8, 2026
19 checks passed
@github-project-automation github-project-automation Bot moved this from Approved to Done in Jellyfin v12 Aug 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

6 participants