mirror of
https://github.com/4gray/iptvnator.git
synced 2026-10-08 17:06:15 -08:00
fix(dashboard): keep a series' season marker when no episode badge names it
The hero stripped a trailing season marker from every series title, so a favorite or newly added series without a playback row lost its only visible season identity. The marker now goes only when the episode badge carries the season. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
1 parent
e9e12f8f0b
commit
b8240b75ab
2 files changed
+24
-8
No files matched your search
+13
@@ -249,6 +249,19 @@ describe('DashboardHeroSlidesPresenter', () => {
|
||||
expect(titles).toContain('Sport S01');
|
||||
});
|
||||
|
||||
it('keeps the season marker of a series that no episode badge describes', () => {
|
||||
// A favorite with no playback row: the marker is the only thing
|
||||
// telling two per-season catalog entries of the show apart.
|
||||
recentItems.set([]);
|
||||
favorites.set([{ ...favoriteFilm, title: 'Burnley (2 сезон)' }]);
|
||||
addedItems.set([]);
|
||||
candidates.set([]);
|
||||
const [slide] = create().slides();
|
||||
|
||||
expect(slide.episodeBadge).toBeNull();
|
||||
expect(slide.title).toBe('Burnley (2 сезон)');
|
||||
});
|
||||
|
||||
it('resumes an unfinished series and offers a detail-only way in', () => {
|
||||
const [resume] = create().slides();
|
||||
|
||||
|
||||
@@ -230,24 +230,27 @@ export class DashboardHeroSlidesPresenter {
|
||||
const watchKind = isLive
|
||||
? 'live'
|
||||
: (resolvePortalActivityWatchKind(item) ?? item.type);
|
||||
const episodeBadge = buildDashboardEpisodeBadge(
|
||||
item,
|
||||
position,
|
||||
(key, params) => this.translate.instant(key, params)
|
||||
);
|
||||
return {
|
||||
...artwork,
|
||||
id: `${source.kind}:${dashboardHeroItemKey(item)}`,
|
||||
kind: source.kind,
|
||||
contentType: item.type,
|
||||
// "Большая фарма (1 сезон)" → "Большая фарма": the episode badge
|
||||
// already names the season. A movie keeps its name as is.
|
||||
// "Большая фарма (1 сезон)" → "Большая фарма" only while the
|
||||
// episode badge names the season; without a badge the marker is
|
||||
// the sole season identity of a per-season catalog entry. A movie
|
||||
// keeps its name as is.
|
||||
title:
|
||||
watchKind === 'series'
|
||||
watchKind === 'series' && episodeBadge
|
||||
? splitSeasonSuffix(item.title).title
|
||||
: item.title,
|
||||
typeLabelKey: TYPE_LABEL_KEYS[watchKind],
|
||||
reasonLabelKey: this.reasonLabelKey(source),
|
||||
episodeBadge: buildDashboardEpisodeBadge(
|
||||
item,
|
||||
position,
|
||||
(key, params) => this.translate.instant(key, params)
|
||||
),
|
||||
episodeBadge,
|
||||
rating: extras?.rating ?? null,
|
||||
genres: extras?.genres ?? [],
|
||||
year: extras?.year ?? item.release_year ?? null,
|
||||
|
||||
Reference in new issue
Block a user