diff --git a/apps/filmpire/src/app/+state/media-info/models/media-info.model.ts b/apps/filmpire/src/app/+state/media-info/models/media-info.model.ts index 206c6a7..5a180fa 100644 --- a/apps/filmpire/src/app/+state/media-info/models/media-info.model.ts +++ b/apps/filmpire/src/app/+state/media-info/models/media-info.model.ts @@ -9,5 +9,6 @@ export interface MediaInfoPage { mediaInfo: MovieDetail | TvShowDetail; accountState: AccountStates; currentMedia: SelectedMedia; + isLoggedIn: boolean; loaded: boolean; } diff --git a/apps/filmpire/src/app/+state/media-info/views/media-info-view.selectors.ts b/apps/filmpire/src/app/+state/media-info/views/media-info-view.selectors.ts index dd73971..ac0887c 100644 --- a/apps/filmpire/src/app/+state/media-info/views/media-info-view.selectors.ts +++ b/apps/filmpire/src/app/+state/media-info/views/media-info-view.selectors.ts @@ -6,17 +6,20 @@ import { } from '../media-info.selectors'; import { selectCurrentMedia } from '../../global/global.selectors'; import { MediaInfoPage } from '../models/media-info.model'; +import { selectIsAuthenticated } from '../../auth/auth.selectors'; export const selectMediaInfoPage = createSelector( selectMediaInfo, selectAccountState, selectCurrentMedia, + selectIsAuthenticated, selectMediaInfoLoaded, - (mediaInfo, accountState, currentMedia, loaded) => + (mediaInfo, accountState, currentMedia, isLoggedIn, loaded) => ({ mediaInfo, accountState, currentMedia, + isLoggedIn, loaded, } as MediaInfoPage) ); diff --git a/apps/filmpire/src/app/+state/profile/profile.effects.ts b/apps/filmpire/src/app/+state/profile/profile.effects.ts index 8e70dba..fff3c43 100644 --- a/apps/filmpire/src/app/+state/profile/profile.effects.ts +++ b/apps/filmpire/src/app/+state/profile/profile.effects.ts @@ -47,16 +47,54 @@ export class ProfileEffects { filter(({ sessionId }) => !!sessionId), concatMap(({ user, sessionId }) => forkJoin({ - favoriteMovies: this.accountHttp.getFavoriteMovies( - user.id, - sessionId + favoriteMovies: this.accountHttp + .getFavoriteMovies(user.id, sessionId) + .pipe( + catchError((error) => { + // Handle error for getFavoriteMovies + return of({ + page: 0, + total_pages: 0, + total_results: 0, + results: [], + }); + }) + ), + favoriteTV: this.accountHttp.getFavouriteTV(user.id, sessionId).pipe( + catchError((error) => { + // Handle error for getFavoriteMovies + return of({ + page: 0, + total_pages: 0, + total_results: 0, + results: [], + }); + }) ), - favoriteTV: this.accountHttp.getFavouriteTV(user.id, sessionId), - watchListMovies: this.accountHttp.getWatchListMovies( - user.id, - sessionId + watchListMovies: this.accountHttp + .getWatchListMovies(user.id, sessionId) + .pipe( + catchError((error) => { + // Handle error for getFavoriteMovies + return of({ + page: 0, + total_pages: 0, + total_results: 0, + results: [], + }); + }) + ), + watchListTV: this.accountHttp.getWatchListTV(user.id, sessionId).pipe( + catchError((error) => { + // Handle error for getFavoriteMovies + return of({ + page: 0, + total_pages: 0, + total_results: 0, + results: [], + }); + }) ), - watchListTV: this.accountHttp.getWatchListTV(user.id, sessionId), }).pipe( map((profileData: ProfileData) => ProfileActions.profileApiActions.loadProfileSuccess({ diff --git a/apps/filmpire/src/app/account/account.component.html b/apps/filmpire/src/app/account/account.component.html index 3d26d29..2e1492e 100644 --- a/apps/filmpire/src/app/account/account.component.html +++ b/apps/filmpire/src/app/account/account.component.html @@ -98,4 +98,5 @@

No items to show. Please add a media to either favorite or watchlist for the item to appear here

+
diff --git a/apps/filmpire/src/app/app.component.html b/apps/filmpire/src/app/app.component.html index f17ca0e..98a00bb 100644 --- a/apps/filmpire/src/app/app.component.html +++ b/apps/filmpire/src/app/app.component.html @@ -18,7 +18,12 @@ > - + Top Cast

: 'assets/actor_avatar_placeholder.jpg' " alt="{{ actor.name }}" - class="mx-auto h-[150px] w-full max-w-[100px] rounded-lg object-cover" + class="mx-auto h-[150px] w-full max-w-[100px] rounded-lg object-cover hover:scale-105" loading="lazy" />

{{ actor.name }}

@@ -195,7 +195,7 @@

Top Cast