F: season page: add mark episode/season as watched
This commit is contained in:
1 parent
30ad2fbf03
commit
09cd4b205a
13 files changed
+187
-63
No files matched your search
@@ -0,0 +1,19 @@
|
||||
import { Pipe, PipeTransform } from '@angular/core';
|
||||
|
||||
@Pipe({
|
||||
name: 'betterMinutesFormat',
|
||||
})
|
||||
export class BetterMinutesFormatPipe implements PipeTransform {
|
||||
transform(value: number | String): string {
|
||||
const minutes = Number.parseInt(value.toString()) || 0;
|
||||
if (minutes == 0) return `0m`;
|
||||
if (minutes < 60) return `${minutes}m`;
|
||||
|
||||
const hours = Math.floor(minutes / 60);
|
||||
const remainingMinutes = minutes % 60;
|
||||
|
||||
if (remainingMinutes == 0) return `${hours}h`;
|
||||
|
||||
return `${hours}h${remainingMinutes}m`;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user