From f68904b2a4efc5680ad80d8e63c116f3f73b626a Mon Sep 17 00:00:00 2001 From: 4gray Date: Sat, 29 Jun 2024 22:27:13 +0200 Subject: [PATCH] refactor: use decimal pipe for rating --- .../category-content-view.component.html | 5 ++++- .../category-content-view/category-content-view.component.ts | 3 ++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/app/xtream/category-content-view/category-content-view.component.html b/src/app/xtream/category-content-view/category-content-view.component.html index 4a3bdf9b1..1d760e11d 100644 --- a/src/app/xtream/category-content-view/category-content-view.component.html +++ b/src/app/xtream/category-content-view/category-content-view.component.html @@ -24,7 +24,10 @@ [matTooltip]="'XTREAM.IMDB_RATING' | translate" > star{{ item.rating || item.rating_imdb }} + >{{ + item.rating || item.rating_imdb + | number: '1.0-2' + }} } diff --git a/src/app/xtream/category-content-view/category-content-view.component.ts b/src/app/xtream/category-content-view/category-content-view.component.ts index bc6298cf9..ec51dbcaa 100644 --- a/src/app/xtream/category-content-view/category-content-view.component.ts +++ b/src/app/xtream/category-content-view/category-content-view.component.ts @@ -1,4 +1,4 @@ -import { NgOptimizedImage } from '@angular/common'; +import { DecimalPipe, NgOptimizedImage } from '@angular/common'; import { Component, EventEmitter, Input, Output, inject } from '@angular/core'; import { MatCardModule } from '@angular/material/card'; import { MatIconModule } from '@angular/material/icon'; @@ -15,6 +15,7 @@ import { PortalStore } from '../portal.store'; styleUrls: ['./category-content-view.component.scss'], standalone: true, imports: [ + DecimalPipe, FilterPipe, MatCardModule, MatIconModule,