diff --git a/src/app/home/recent-playlists/playlist-item/playlist-item.component.html b/src/app/home/recent-playlists/playlist-item/playlist-item.component.html index c905c6dde..dffad27c7 100644 --- a/src/app/home/recent-playlists/playlist-item/playlist-item.component.html +++ b/src/app/home/recent-playlists/playlist-item/playlist-item.component.html @@ -18,13 +18,18 @@ [matTooltip]="'HOME.PLAYLISTS.ADDED_VIA_FILE' | translate" >folder - public +
+ public + +
dashboard -
{{ item.title || item.filename }}
+
+ {{ item.title || item.filename }} +
(); @Output() refreshClicked = new EventEmitter(); @Output() removeClicked = new EventEmitter(); + + portalStatus: 'active' | 'inactive' | 'expired' | 'unavailable' = + 'unavailable'; + private readonly dataService = inject(DataService); + + // eslint-disable-next-line @typescript-eslint/no-misused-promises + async ngOnInit() { + if (this.item?.serverUrl) { + await this.checkPortalStatus(); + } + } + + private async checkPortalStatus() { + try { + const response = await this.dataService.fetchData( + `${this.item.serverUrl}/player_api.php`, + { + username: this.item.username, + password: this.item.password, + action: 'get_account_info', + } + ); + + if (!response?.user_info?.status) { + this.portalStatus = 'unavailable'; + return; + } + + if (response.user_info.status === 'Active') { + const expDate = new Date( + parseInt(response.user_info.exp_date) * 1000 + ); + this.portalStatus = expDate < new Date() ? 'expired' : 'active'; + } else { + this.portalStatus = 'inactive'; + } + } catch (error) { + console.error('Error checking portal status:', error); + this.portalStatus = 'unavailable'; + } + } + + getStatusClass(): string { + return `status-${this.portalStatus}`; + } } diff --git a/src/app/player/components/channel-list-container/channel-list-item/channel-list-item.component.scss b/src/app/player/components/channel-list-container/channel-list-item/channel-list-item.component.scss index 975aa4302..afe5d445f 100644 --- a/src/app/player/components/channel-list-container/channel-list-item/channel-list-item.component.scss +++ b/src/app/player/components/channel-list-container/channel-list-item/channel-list-item.component.scss @@ -6,6 +6,17 @@ -webkit-box-orient: vertical; font-size: 0.9em; max-width: 290px; + transition: color 0.2s ease; + width: 100%; + position: relative; + overflow: hidden; + + &:hover { + overflow: visible; + text-overflow: clip; + animation: marquee 6s linear infinite; + } + } .active {