mirror of
https://github.com/movie-web/movie-web.git
synced 2025-01-13 14:09:07 +01:00
feat: add season/episode to the start of title
This commit is contained in:
parent
18e9bdbfc5
commit
256f9f9df9
@ -104,9 +104,15 @@ export function MediaSession() {
|
||||
)
|
||||
return;
|
||||
|
||||
const title = data.meta?.episode?.title ?? data.meta?.title ?? "";
|
||||
const artist =
|
||||
data.meta?.type === "movie" ? undefined : data.meta?.title ?? "";
|
||||
let title: string | undefined;
|
||||
let artist: string | undefined;
|
||||
|
||||
if (data.meta?.type === "movie") {
|
||||
title = data.meta?.title;
|
||||
} else if (data.meta?.type === "show") {
|
||||
artist = data.meta?.title;
|
||||
title = `S${data.meta?.season?.number} E${data.meta?.episode?.number}: ${data.meta?.episode?.title}`;
|
||||
}
|
||||
|
||||
navigator.mediaSession.metadata = new MediaMetadata({
|
||||
title,
|
||||
@ -170,6 +176,7 @@ export function MediaSession() {
|
||||
data.meta?.title,
|
||||
data.meta?.type,
|
||||
data.meta?.poster,
|
||||
data.meta?.season?.number,
|
||||
]);
|
||||
return null;
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user