fix: enforce bucket order through Jellyfin's sort + original-language position (#2)
v0.8.0's regional-variant support shipped three ranking bugs, all rooted in
Jellyfin's downstream re-processing of the returned image list:
- Jellyfin's filter only keeps images tagged {empty, library-language, "en"}.
We tagged override codes and kept regional variants at their bare iso, so
pt-pt and override languages in non-matching libraries were filtered out
(only English survived). - Jellyfin's OrderByLanguageDescending sorts by language-score, then
CommunityRating, then VoteCount. Disguising the original language as preferred
put it in the same tier and let high-vote-count originals (anime) leapfrog the
preferred-language posters.
Fix: tag every kept image with the library metadata language (so all pass the
filter and share the top language tier) and bake the bucket rank into
CommunityRating (lower rank -> higher value) so our order survives Jellyfin's
re-sort regardless of vote counts. SortByVotes now controls the within-bucket
tiebreak (VoteCount, or vote_average when off). This collapses the old
DisguiseLanguage / fallback-iso / CommunityRating-suppression special cases into
one mechanism.
New OriginalLanguageLast option (default true): the original-language bucket
sits after the fallback languages so international names win; set false for the
old between-preferred-and-fallback position.
Cosmetic trade-offs (accepted): the picker shows synthetic ratings instead of
TMDB's, and every image is labelled with the library language even when it is a
regional variant or the original language.
Co-Authored-By: Claude Opus 4.8 (1M context) noreply@anthropic.com