fix(web): unrated movies show no rating
This commit is contained in:
+1
-1
@@ -1469,7 +1469,7 @@ function movieMain(board: HTMLElement, views: HideableView[]): MovieView {
|
|||||||
hero.classList.add("has-backdrop");
|
hero.classList.add("has-backdrop");
|
||||||
hero.style.setProperty("--backdrop", `url("${backdropUrl}")`);
|
hero.style.setProperty("--backdrop", `url("${backdropUrl}")`);
|
||||||
}
|
}
|
||||||
if (detail.vote_count > 0) {
|
if (detail.vote_average !== null) {
|
||||||
ratingEl.hidden = false;
|
ratingEl.hidden = false;
|
||||||
ratingEl.append(starIcon(), document.createTextNode(`${formatRating(detail.vote_average)} `));
|
ratingEl.append(starIcon(), document.createTextNode(`${formatRating(detail.vote_average)} `));
|
||||||
const votes = document.createElement("span");
|
const votes = document.createElement("span");
|
||||||
|
|||||||
+2
-1
@@ -30,7 +30,8 @@ export interface MovieMetadata {
|
|||||||
status: string;
|
status: string;
|
||||||
poster_path: string | null;
|
poster_path: string | null;
|
||||||
backdrop_path: string | null;
|
backdrop_path: string | null;
|
||||||
vote_average: number;
|
/** `null` when TMDB has no votes for the title (#156). */
|
||||||
|
vote_average: number | null;
|
||||||
vote_count: number;
|
vote_count: number;
|
||||||
homepage: string | null;
|
homepage: string | null;
|
||||||
imdb_id: string | null;
|
imdb_id: string | null;
|
||||||
|
|||||||
Reference in New Issue
Block a user