feat(category-view): add showCounts input to conditionally display item counts

This commit is contained in:
4gray committed 2026-01-07 23:40:28 +01:00
1 parent f2b59d3994
commit 5070c2a707
5 files changed
+13 -1

No files matched your search

@@ -9,7 +9,9 @@
{{
item.category_name || $any(item).name || 'No category name'
}}
<span class="item-count">({{ getItemCount(item) }})</span>
@if (showCounts()) {
<span class="item-count">({{ getItemCount(item) }})</span>
}
</mat-list-item>
} @empty {
<app-playlist-error-view
@@ -20,6 +20,7 @@ export class CategoryViewComponent {
readonly items = input([]);
readonly selectedCategoryId = input<number>();
readonly itemCounts = input<Map<number, number>>(new Map());
readonly showCounts = input<boolean>(false);
readonly categoryClicked = output<XtreamCategory>();
@@ -30,6 +30,7 @@
[items]="categories()"
[itemCounts]="categoryItemCounts()"
(categoryClicked)="selectCategory($event)"
[showCounts]="true"
/>
}
</div>
@@ -84,6 +84,13 @@ export class LiveStreamLayoutComponent implements OnInit {
playLive(item: any) {
const streamUrl = this.xtreamStore.constructStreamUrl(item);
this.streamUrl = streamUrl;
const isEmbeddedPlayer =
this.player() === 'videojs' ||
this.player() === 'html5' ||
this.player() === 'artplayer';
if (isEmbeddedPlayer) {
return;
}
this.xtreamStore.openPlayer(streamUrl, item.title, item.poster_url);
}
@@ -18,6 +18,7 @@
[selectedCategoryId]="selectedCategoryId()"
[itemCounts]="categoryItemCounts()"
(categoryClicked)="categoryClicked($event)"
[showCounts]="true"
/>
</div>