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'
|
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>
|
</mat-list-item>
|
||||||
} @empty {
|
} @empty {
|
||||||
<app-playlist-error-view
|
<app-playlist-error-view
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ export class CategoryViewComponent {
|
|||||||
readonly items = input([]);
|
readonly items = input([]);
|
||||||
readonly selectedCategoryId = input<number>();
|
readonly selectedCategoryId = input<number>();
|
||||||
readonly itemCounts = input<Map<number, number>>(new Map());
|
readonly itemCounts = input<Map<number, number>>(new Map());
|
||||||
|
readonly showCounts = input<boolean>(false);
|
||||||
|
|
||||||
readonly categoryClicked = output<XtreamCategory>();
|
readonly categoryClicked = output<XtreamCategory>();
|
||||||
|
|
||||||
|
|||||||
@@ -30,6 +30,7 @@
|
|||||||
[items]="categories()"
|
[items]="categories()"
|
||||||
[itemCounts]="categoryItemCounts()"
|
[itemCounts]="categoryItemCounts()"
|
||||||
(categoryClicked)="selectCategory($event)"
|
(categoryClicked)="selectCategory($event)"
|
||||||
|
[showCounts]="true"
|
||||||
/>
|
/>
|
||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -84,6 +84,13 @@ export class LiveStreamLayoutComponent implements OnInit {
|
|||||||
playLive(item: any) {
|
playLive(item: any) {
|
||||||
const streamUrl = this.xtreamStore.constructStreamUrl(item);
|
const streamUrl = this.xtreamStore.constructStreamUrl(item);
|
||||||
this.streamUrl = streamUrl;
|
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);
|
this.xtreamStore.openPlayer(streamUrl, item.title, item.poster_url);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -18,6 +18,7 @@
|
|||||||
[selectedCategoryId]="selectedCategoryId()"
|
[selectedCategoryId]="selectedCategoryId()"
|
||||||
[itemCounts]="categoryItemCounts()"
|
[itemCounts]="categoryItemCounts()"
|
||||||
(categoryClicked)="categoryClicked($event)"
|
(categoryClicked)="categoryClicked($event)"
|
||||||
|
[showCounts]="true"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user