🐛 Anonymous Plex user

This commit is contained in:
Manuel
2023-04-14 12:22:11 +02:00
parent 632a9967fd
commit 5ae6b39fa9
3 changed files with 85 additions and 25 deletions

View File

@@ -33,7 +33,7 @@ export class PlexClient {
const mediaElement = this.findElement('Media', videoElement.elements);
const sessionElement = this.findElement('Session', videoElement.elements);
if (!userElement || !playerElement || !mediaElement || !sessionElement) {
if (!playerElement || !mediaElement) {
return undefined;
}
@@ -43,9 +43,9 @@ export class PlexClient {
const transcodingElement = this.findElement('TranscodeSession', videoElement.elements);
return {
id: sessionElement.id as string,
username: userElement.title as string,
userProfilePicture: userElement.thumb as string,
id: (sessionElement?.id as string | undefined),
username: userElement?.title ?? 'Anonymous' as string,
userProfilePicture: userElement?.thumb as string | undefined,
sessionName: `${playerElement.product} (${playerElement.title})`,
currentlyPlaying: {
name: videoElement.attributes?.title as string,