diff --git a/libs/playlist/shared/ui/src/lib/recent-playlists/playlist-item/playlist-item.component.html b/libs/playlist/shared/ui/src/lib/recent-playlists/playlist-item/playlist-item.component.html
index 2b30109bd..844252b24 100644
--- a/libs/playlist/shared/ui/src/lib/recent-playlists/playlist-item/playlist-item.component.html
+++ b/libs/playlist/shared/ui/src/lib/recent-playlists/playlist-item/playlist-item.component.html
@@ -19,16 +19,18 @@
}
- @switch (sourceIconKey) {
- @case ('stalker') {
- {{ sourceIcons.stalker }}
- }
- @case ('xtream') {
-
+
+ @switch (sourceIconKey) {
+ @case ('stalker') {
+ {{ sourceIcons.stalker }}
+ }
+ @case ('xtream') {
{{ sourceIcons.xtream }}
- @if (!runtime.supportsSourceHealth) {
-
- }
-
+ }
+ @case ('m3u-url') {
+
{{ sourceIcons['m3u-url'] }}
+ }
+ @default {
+
{{ sourceIcons['m3u-local'] }}
+ }
}
- @default {
-
- @if (sourceIconKey === 'm3u-url') {
- {{ sourceIcons['m3u-url'] }}
- } @else {
- {{ sourceIcons['m3u-local'] }}
- }
- @if (item.autoRefresh) {
- autorenew
- }
-
+ @if (showsPortalStatusDot) {
+
+ } @else if (showsAutoRefresh) {
+
autorenew
}
- }
+
diff --git a/libs/playlist/shared/ui/src/lib/recent-playlists/playlist-item/playlist-item.component.spec.ts b/libs/playlist/shared/ui/src/lib/recent-playlists/playlist-item/playlist-item.component.spec.ts
index 2ed168c99..585d0b46a 100644
--- a/libs/playlist/shared/ui/src/lib/recent-playlists/playlist-item/playlist-item.component.spec.ts
+++ b/libs/playlist/shared/ui/src/lib/recent-playlists/playlist-item/playlist-item.component.spec.ts
@@ -226,16 +226,15 @@ describe('PlaylistItemComponent', () => {
[
{ macAddress: '00:1A:79:00:00:01', url: 'http://portal.test' },
'cast',
+ true,
],
- [
- { serverUrl: 'http://xtream.test', url: 'http://xtream.test' },
- 'cloud',
- ],
- [{ url: 'http://list.test/playlist.m3u' }, 'link'],
- [{}, 'description'],
+ [{ macAddress: '00:1A:79:00:00:01' }, 'cast', false],
+ [{ serverUrl: 'http://xtream.test' }, 'cloud', false],
+ [{ url: 'http://list.test/playlist.m3u' }, 'link', true],
+ [{}, 'description', true],
])(
- 'shows one provider icon for %o, with the shared precedence',
- (source, icon) => {
+ 'shows one provider icon for %o (%s) and keeps the auto-refresh badge: %s',
+ (source, icon, autoRefreshBadge) => {
fixture.destroy();
fixture = TestBed.createComponent(PlaylistItemComponent);
fixture.componentInstance.item = {
@@ -243,18 +242,20 @@ describe('PlaylistItemComponent', () => {
_id: 'source',
count: 10,
importDate: Date.now().toString(),
- autoRefresh: false,
+ autoRefresh: true,
...source,
};
fixture.detectChanges();
+ const row = fixture.nativeElement as HTMLElement;
const icons = Array.from(
- (fixture.nativeElement as HTMLElement).querySelectorAll(
- '.upload-type-icon'
- ),
+ row.querySelectorAll('.upload-type-icon'),
(element) => element.textContent?.trim()
);
expect(icons).toEqual([icon]);
+ expect(row.querySelector('.auto-refresh-indicator') !== null).toBe(
+ autoRefreshBadge
+ );
}
);
});
diff --git a/libs/playlist/shared/ui/src/lib/recent-playlists/playlist-item/playlist-item.component.ts b/libs/playlist/shared/ui/src/lib/recent-playlists/playlist-item/playlist-item.component.ts
index 77a13aef4..033de62c5 100644
--- a/libs/playlist/shared/ui/src/lib/recent-playlists/playlist-item/playlist-item.component.ts
+++ b/libs/playlist/shared/ui/src/lib/recent-playlists/playlist-item/playlist-item.component.ts
@@ -78,6 +78,25 @@ export class PlaylistItemComponent implements OnInit {
get sourceIconKey(): PlaylistSourceIconKey {
return resolvePlaylistSourceIconKey(this.item);
}
+
+ /** Without source health, Xtream rows badge the portal status instead. */
+ get showsPortalStatusDot(): boolean {
+ return (
+ this.sourceIconKey === 'xtream' &&
+ !this.runtime.supportsSourceHealth
+ );
+ }
+
+ /**
+ * Auto-refresh re-fetches a URL or a local file, so any row with a URL
+ * keeps the badge, whichever provider icon it shows.
+ */
+ get showsAutoRefresh(): boolean {
+ return (
+ !!this.item.autoRefresh &&
+ (!!this.item.url || this.sourceIconKey === 'm3u-local')
+ );
+ }
private readonly translate = inject(TranslateService);
private readonly languageTick = toSignal(
this.translate.onLangChange.pipe(startWith(null)),