mirror of
https://github.com/Mastermindzh/tidal-hifi.git
synced 2025-07-27 16:12:29 +02:00
fix: fixes #403 - cannot read shuffle of undefined error
This commit is contained in:
@@ -14,5 +14,5 @@ export interface MediaInfo {
|
||||
durationInSeconds?: number;
|
||||
image: string;
|
||||
favorite: boolean;
|
||||
player: MediaPlayerInfo;
|
||||
player?: MediaPlayerInfo;
|
||||
}
|
||||
|
@@ -20,7 +20,7 @@ export const mediaInfo = {
|
||||
status: MediaStatus.paused as string,
|
||||
shuffle: false,
|
||||
repeat: RepeatState.off as string,
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
export const updateMediaInfo = (arg: MediaInfo) => {
|
||||
@@ -37,9 +37,11 @@ export const updateMediaInfo = (arg: MediaInfo) => {
|
||||
mediaInfo.image = propOrDefault(arg.image);
|
||||
mediaInfo.favorite = arg.favorite;
|
||||
|
||||
mediaInfo.player.status = propOrDefault(arg.player?.status);
|
||||
mediaInfo.player.shuffle = arg.player.shuffle;
|
||||
mediaInfo.player.repeat = propOrDefault(arg.player?.repeat);
|
||||
mediaInfo.player = {
|
||||
status: propOrDefault(arg.player?.status),
|
||||
shuffle: arg.player?.shuffle ?? false,
|
||||
repeat: propOrDefault(arg.player?.repeat),
|
||||
};
|
||||
};
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user