mirror of
https://github.com/movie-web/movie-web.git
synced 2025-01-28 00:35:41 +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;
|
return;
|
||||||
|
|
||||||
const title = data.meta?.episode?.title ?? data.meta?.title ?? "";
|
let title: string | undefined;
|
||||||
const artist =
|
let artist: string | undefined;
|
||||||
data.meta?.type === "movie" ? undefined : data.meta?.title ?? "";
|
|
||||||
|
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({
|
navigator.mediaSession.metadata = new MediaMetadata({
|
||||||
title,
|
title,
|
||||||
@ -170,6 +176,7 @@ export function MediaSession() {
|
|||||||
data.meta?.title,
|
data.meta?.title,
|
||||||
data.meta?.type,
|
data.meta?.type,
|
||||||
data.meta?.poster,
|
data.meta?.poster,
|
||||||
|
data.meta?.season?.number,
|
||||||
]);
|
]);
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user