mirror of
https://github.com/4gray/iptvnator.git
synced 2026-10-08 09:01:03 -08:00
feat(category-view): add showCounts input to conditionally display item counts
This commit is contained in:
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>
|
||||
|
||||
|
||||
Reference in new issue
Block a user