mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
Fix handling of undefined text lines
This commit is contained in:
parent
68bac124af
commit
1cbb4d071b
2 changed files with 7 additions and 4 deletions
|
@ -26,6 +26,7 @@ function getSeriesImageUrl(item: ItemDto, options: ImageOptions = {}) {
|
||||||
|
|
||||||
return ServerConnections.getApiClient(item.ServerId).getScaledImageUrl(item.SeriesId, options);
|
return ServerConnections.getApiClient(item.ServerId).getScaledImageUrl(item.SeriesId, options);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (item.ParentThumbItemId && item.ParentThumbImageTag) {
|
if (item.ParentThumbItemId && item.ParentThumbImageTag) {
|
||||||
options.tag = item.ParentThumbImageTag;
|
options.tag = item.ParentThumbImageTag;
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@ import { MediaType } from '@jellyfin/sdk/lib/generated-client/models/media-type'
|
||||||
|
|
||||||
import { getImageUrl } from 'apps/stable/features/playback/utils/image';
|
import { getImageUrl } from 'apps/stable/features/playback/utils/image';
|
||||||
import { PlaybackSubscriber } from 'apps/stable/features/playback/utils/playbackSubscriber';
|
import { PlaybackSubscriber } from 'apps/stable/features/playback/utils/playbackSubscriber';
|
||||||
import nowplayinghelper from 'components/playback/nowplayinghelper';
|
import { getNowPlayingNames } from 'components/playback/nowplayinghelper';
|
||||||
import type { PlaybackManager } from 'components/playback/playbackmanager';
|
import type { PlaybackManager } from 'components/playback/playbackmanager';
|
||||||
import { MILLISECONDS_PER_SECOND, TICKS_PER_MILLISECOND } from 'constants/time';
|
import { MILLISECONDS_PER_SECOND, TICKS_PER_MILLISECOND } from 'constants/time';
|
||||||
import browser from 'scripts/browser';
|
import browser from 'scripts/browser';
|
||||||
|
@ -110,9 +110,11 @@ class MediaSessionSubscriber extends PlaybackSubscriber {
|
||||||
}
|
}
|
||||||
|
|
||||||
const album = item.Album || undefined;
|
const album = item.Album || undefined;
|
||||||
const names = nowplayinghelper.getNowPlayingNames(item);
|
const [ line1, line2 ] = getNowPlayingNames(item, false) || [];
|
||||||
const artist = names[names.length - 1].text;
|
// The artist will be the second line if present or the first line otherwise
|
||||||
const title = names.length === 1 ? undefined : names[0].text;
|
const artist = (line2 || line1)?.text;
|
||||||
|
// The title will be the first line if there are two lines
|
||||||
|
const title = (line2 && line1)?.text;
|
||||||
|
|
||||||
if (hasNavigatorSession) {
|
if (hasNavigatorSession) {
|
||||||
if (
|
if (
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue