mirror of
https://github.com/aleksilassila/reiverr.git
synced 2026-04-22 00:35:12 +02:00
Initial work on library page
This commit is contained in:
12
src/lib/utils.ts
Normal file
12
src/lib/utils.ts
Normal file
@@ -0,0 +1,12 @@
|
||||
import type { Genre } from '$lib/tmdb-api';
|
||||
|
||||
export function getRuntime(minutes: number) {
|
||||
const hours = Math.floor(minutes / 60);
|
||||
const mins = Math.floor(minutes % 60);
|
||||
|
||||
return `${hours > 0 ? hours + 'h ' : ''}${mins}min`;
|
||||
}
|
||||
|
||||
export function formatGenres(genres: Genre[]) {
|
||||
return genres.map((genre) => genre.name.charAt(0).toUpperCase() + genre.name.slice(1)).join(', ');
|
||||
}
|
||||
Reference in New Issue
Block a user