diff --git a/apps/web/src/app/app.component.spec.ts b/apps/web/src/app/app.component.spec.ts index 2061a1fb9..4ab97362d 100644 --- a/apps/web/src/app/app.component.spec.ts +++ b/apps/web/src/app/app.component.spec.ts @@ -12,20 +12,16 @@ import { provideMockStore } from '@ngrx/store/testing'; import { TranslatePipe, TranslateService } from '@ngx-translate/core'; import { MockComponent, MockModule, MockPipe, MockProviders } from 'ng-mocks'; import { NgxIndexedDBService } from 'ngx-indexed-db'; -import { NgxWhatsNewComponent } from 'ngx-whats-new'; import { of } from 'rxjs'; -import { DataService } from '../../../../libs/services/src/lib/data.service'; -import { PlaylistsService } from '../../../../libs/services/src/lib/playlists.service'; -import { Language } from '../../../../libs/shared/interfaces/src/lib/language.enum'; -import { STORE_KEY } from '../../../../libs/shared/interfaces/src/lib/store-keys.enum'; -import { Theme } from '../../../../libs/shared/interfaces/src/lib/theme.enum'; +import { DataService, PlaylistsService } from 'services'; +import { Language, STORE_KEY, Theme } from 'shared-interfaces'; import { AppComponent } from './app.component'; import { ElectronServiceStub } from './services/electron.service.stub'; import { SettingsService } from './services/settings.service'; -import { WhatsNewService } from './services/whats-new.service'; -import { WhatsNewServiceStub } from './services/whats-new.service.stub'; -jest.spyOn(global.console, 'error').mockImplementation(() => {}); +jest.spyOn(global.console, 'error').mockImplementation(() => { + // suppress console.error output during tests +}); describe('AppComponent', () => { let component: AppComponent; @@ -33,14 +29,12 @@ describe('AppComponent', () => { let fixture: ComponentFixture; let settingsService: SettingsService; let translateService: TranslateService; - let whatsNewService: WhatsNewService; const defaultLanguage = 'en'; beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ declarations: [AppComponent, MockPipe(TranslatePipe)], providers: [ - { provide: WhatsNewService, useClass: WhatsNewServiceStub }, MockProviders( TranslateService, PlaylistsService, @@ -68,7 +62,6 @@ describe('AppComponent', () => { fixture = TestBed.createComponent(AppComponent); settingsService = TestBed.inject(SettingsService); translateService = TestBed.inject(TranslateService); - whatsNewService = TestBed.inject(WhatsNewService); component = fixture.componentInstance; // TODO: investigate in detail @@ -128,14 +121,6 @@ describe('AppComponent', () => { expect(router.navigateByUrl).toHaveBeenCalledWith(route); } )); - - it('show show whats new dialog', () => { - jest.spyOn(whatsNewService, 'getModalsByVersion'); - jest.spyOn(component, 'setDialogVisibility'); - component.showWhatsNewDialog(); - expect(whatsNewService.getModalsByVersion).toHaveBeenCalledTimes(1); - expect(component.setDialogVisibility).toHaveBeenCalledWith(true); - }); }); describe('Test version handling', () => { @@ -144,17 +129,8 @@ describe('AppComponent', () => { const spyOnSettingsGet = jest .spyOn(settingsService, 'getValueFromLocalStorage') .mockReturnValue(of(currentAppVersion)); - jest.spyOn(whatsNewService, 'getModalsByVersion').mockReturnValue([ - {}, - ]); - jest.spyOn(whatsNewService, 'changeDialogVisibleState'); - component.handleWhatsNewDialog(); expect(spyOnSettingsGet).toHaveBeenCalled(); - expect(whatsNewService.getModalsByVersion).toHaveBeenCalled(); - expect( - whatsNewService.changeDialogVisibleState - ).toHaveBeenCalledWith(true); }); it('should get actual app version which is not outdated and do not shop updates dialog', () => { @@ -162,40 +138,8 @@ describe('AppComponent', () => { const spyOnSettingsGet = jest .spyOn(settingsService, 'getValueFromLocalStorage') .mockReturnValue(of(currentAppVersion)); - jest.spyOn(whatsNewService, 'getModalsByVersion').mockReturnValue([ - {}, - ]); - jest.spyOn(whatsNewService, 'changeDialogVisibleState'); - component.handleWhatsNewDialog(); expect(spyOnSettingsGet).toHaveBeenCalled(); - expect(whatsNewService.getModalsByVersion).toHaveBeenCalledTimes(0); - expect( - whatsNewService.changeDialogVisibleState - ).toHaveBeenCalledTimes(0); - }); - - it('should change the visibility of the whats new dialog', () => { - jest.spyOn(whatsNewService, 'changeDialogVisibleState'); - component.modals = [{}, {}]; - const visibilityFlag = true; - component.setDialogVisibility(true); - - expect( - whatsNewService.changeDialogVisibleState - ).toHaveBeenCalledWith(visibilityFlag); - expect( - whatsNewService.changeDialogVisibleState - ).toHaveBeenCalledTimes(1); - }); - - it('should not change the visibility of the whats new dialog', () => { - jest.spyOn(whatsNewService, 'changeDialogVisibleState'); - component.modals = []; - component.setDialogVisibility(true); - expect( - whatsNewService.changeDialogVisibleState - ).toHaveBeenCalledTimes(0); }); }); diff --git a/apps/web/src/app/xtream-tauri/category-content-view/category-content-view.component.ts b/apps/web/src/app/xtream-tauri/category-content-view/category-content-view.component.ts index d7942b099..655bcfd9e 100644 --- a/apps/web/src/app/xtream-tauri/category-content-view/category-content-view.component.ts +++ b/apps/web/src/app/xtream-tauri/category-content-view/category-content-view.component.ts @@ -1,6 +1,5 @@ import { Component, inject, OnInit } from '@angular/core'; -import { MatCardModule } from '@angular/material/card'; -import { MatPaginatorModule, PageEvent } from '@angular/material/paginator'; +import { PageEvent } from '@angular/material/paginator'; import { ActivatedRoute, Router } from '@angular/router'; import { Store } from '@ngrx/store'; import { TranslatePipe } from '@ngx-translate/core'; @@ -16,13 +15,11 @@ import { XtreamStore } from '../xtream.store'; templateUrl: './category-content-view.component.html', styleUrls: ['./category-content-view.component.scss'], imports: [ - MatCardModule, - MatPaginatorModule, + GridListComponent, PlaylistErrorViewComponent, + StalkerSeriesViewComponent, TranslatePipe, VodDetailsComponent, - GridListComponent, - StalkerSeriesViewComponent, ], }) export class CategoryContentViewComponent implements OnInit { diff --git a/apps/web/src/app/xtream-tauri/player-dialog/player-dialog.component.html b/apps/web/src/app/xtream-tauri/player-dialog/player-dialog.component.html index 34bd66a04..efe236c70 100644 --- a/apps/web/src/app/xtream-tauri/player-dialog/player-dialog.component.html +++ b/apps/web/src/app/xtream-tauri/player-dialog/player-dialog.component.html @@ -1,20 +1,13 @@

{{ title }}

- - -   - @if (!isFavorite) { - + alt="Movie poster" + /> } @else { - +
} - - - - @if (item.info.youtube_trailer) { +
+

{{ item.info.name }}

+ @if (item.info.description) { +
+ {{ item.info.description }} +
+ } + @if (item.info.releasedate) { +
{{ 'XTREAM.RELEASE_DATE' | translate }}:
+ {{ item.info.releasedate }} + } + @if (item.info.genre) { +
{{ 'XTREAM.GENRE' | translate }}:
+ {{ item.info.genre }} + } + @if (item.info.country) { +
{{ 'XTREAM.COUNTRY' | translate }}:
+ {{ item.info.country }} + } + @if (item.info.actors) { +
+
{{ 'XTREAM.ACTORS' | translate }}:
+ {{ item.info.actors }} +
+ } + @if (item.info.director) { +
{{ 'XTREAM.DIRECTOR' | translate }}:
+ {{ item.info.director }} + } + @if (item.info.duration) { +
{{ 'XTREAM.DURATION' | translate }}:
+ {{ item.info.duration }} + } + @if (item.info.rating_imdb) { +
{{ 'XTREAM.IMDB_RATING' | translate }}:
+ {{ item.info.rating_imdb }} + } + @if (item.info.rating_kinopoisk) { +
+ {{ 'XTREAM.KINOPOISK_RATING' | translate }}: +
+ {{ item.info.rating_kinopoisk }} + } +
+   + @if (!isFavorite) { + + } @else { + + } +
+
+ +@if (item.info.youtube_trailer) {
-

{{ 'XTREAM.YOUTUBE_TRAILER' | translate }}

- +

{{ 'XTREAM.YOUTUBE_TRAILER' | translate }}

+
- } +} diff --git a/apps/web/src/app/xtream/vod-details/vod-details.component.ts b/apps/web/src/app/xtream/vod-details/vod-details.component.ts index 0abda93a3..21bb0c86e 100644 --- a/apps/web/src/app/xtream/vod-details/vod-details.component.ts +++ b/apps/web/src/app/xtream/vod-details/vod-details.component.ts @@ -13,7 +13,7 @@ import { ActivatedRoute } from '@angular/router'; import { TranslatePipe } from '@ngx-translate/core'; import { PlaylistsService } from 'services'; import { XtreamVodDetails } from 'shared-interfaces'; -import { SafePipe } from './safe.pipe'; +import { SafePipe } from '../../xtream-tauri/vod-details/safe.pipe'; @Component({ selector: 'app-vod-details', diff --git a/apps/web/src/app/xtream/xtream-main-container.component.ts b/apps/web/src/app/xtream/xtream-main-container.component.ts index fc7a0233d..baea93c55 100644 --- a/apps/web/src/app/xtream/xtream-main-container.component.ts +++ b/apps/web/src/app/xtream/xtream-main-container.component.ts @@ -41,6 +41,10 @@ import { import { LiveStreamLayoutComponent } from 'shared-portals'; import { SettingsStore } from '../services/settings-store.service'; import { ExternalPlayerInfoDialogComponent } from '../shared/components/external-player-info-dialog/external-player-info-dialog.component'; +import { + PlayerDialogComponent, + PlayerDialogData, +} from '../xtream-tauri/player-dialog/player-dialog.component'; import { PlaylistErrorViewComponent } from '../xtream/playlist-error-view/playlist-error-view.component'; import { Breadcrumb, PortalActions } from './breadcrumb.interface'; import { CategoryContentViewComponent } from './category-content-view/category-content-view.component'; @@ -48,10 +52,6 @@ import { CategoryViewComponent } from './category-view/category-view.component'; import { ContentTypeNavigationItem } from './content-type-navigation-item.interface'; import { ContentType } from './content-type.enum'; import { NavigationBarComponent } from './navigation-bar/navigation-bar.component'; -import { - PlayerDialogComponent, - PlayerDialogData, -} from './player-dialog/player-dialog.component'; import { PortalStore } from './portal.store'; import { SerialDetailsComponent } from './serial-details/serial-details.component'; import { VodDetailsComponent } from './vod-details/vod-details.component'; @@ -395,7 +395,8 @@ export class XtreamMainContainerComponent implements OnInit, OnDestroy { playEpisode(episode: XtreamSerieEpisode) { const playlist = this.currentPlaylist() as Playlist; - const { serverUrl, username, password, userAgent, referrer, origin } = playlist; + const { serverUrl, username, password, userAgent, referrer, origin } = + playlist; const player = this.settingsStore.player(); const streamUrl = `${serverUrl}/series/${username}/${password}/${episode.id}.${episode.container_extension}`; if (player === VideoPlayer.MPV) {