Fixed a bug with user reviews (#2677)

This commit is contained in:
Joe Milazzo 2024-02-01 14:30:44 -06:00 committed by GitHub
parent 828d62dfe9
commit a9ab84803e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 22 additions and 10 deletions

View file

@ -3,7 +3,7 @@ import {UserReview} from "../../_single-module/review-card/user-review";
import {Rating} from "../rating";
export interface SeriesDetailPlus {
recommendations: Recommendation;
recommendations?: Recommendation;
reviews: Array<UserReview>;
ratings: Array<Rating>;
ratings?: Array<Rating>;
}

View file

@ -587,7 +587,7 @@ export class SeriesDetailComponent implements OnInit, AfterContentChecked {
});
this.setContinuePoint();
if (KavitaPlusSupportedLibraryTypes.includes(this.libraryType) && loadExternal) {
if (loadExternal) {
this.loadPlusMetadata(this.seriesId);
}
@ -701,10 +701,16 @@ export class SeriesDetailComponent implements OnInit, AfterContentChecked {
// Reviews
this.reviews = [...data.reviews];
this.ratings = [...data.ratings];
if (data.ratings) {
this.ratings = [...data.ratings];
}
// Recommendations
this.combinedRecs = [...data.recommendations.ownedSeries, ...data.recommendations.externalSeries];
if (data.recommendations) {
this.combinedRecs = [...data.recommendations.ownedSeries, ...data.recommendations.externalSeries];
}
this.hasRecommendations = this.combinedRecs.length > 0;
this.cdRef.markForCheck();