mirror of
https://github.com/Mastermindzh/tidal-hifi.git
synced 2024-11-22 05:23:09 +01:00
fix: fixes #403 - cannot read shuffle of undefined error
This commit is contained in:
parent
3740ce5a12
commit
b481108af1
@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.
|
|||||||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
||||||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||||
|
|
||||||
|
## [next]
|
||||||
|
|
||||||
|
- Fixed [#403](https://github.com/Mastermindzh/tidal-hifi/issues/403) "cannot read shuffle of undefined" error
|
||||||
|
|
||||||
## [5.12.0]
|
## [5.12.0]
|
||||||
|
|
||||||
- Added Shuffle and Repeat state to API response - By [ThatGravyBoat](https://github.com/ThatGravyBoat)
|
- Added Shuffle and Repeat state to API response - By [ThatGravyBoat](https://github.com/ThatGravyBoat)
|
||||||
|
@ -14,5 +14,5 @@ export interface MediaInfo {
|
|||||||
durationInSeconds?: number;
|
durationInSeconds?: number;
|
||||||
image: string;
|
image: string;
|
||||||
favorite: boolean;
|
favorite: boolean;
|
||||||
player: MediaPlayerInfo;
|
player?: MediaPlayerInfo;
|
||||||
}
|
}
|
||||||
|
@ -20,7 +20,7 @@ export const mediaInfo = {
|
|||||||
status: MediaStatus.paused as string,
|
status: MediaStatus.paused as string,
|
||||||
shuffle: false,
|
shuffle: false,
|
||||||
repeat: RepeatState.off as string,
|
repeat: RepeatState.off as string,
|
||||||
}
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
export const updateMediaInfo = (arg: MediaInfo) => {
|
export const updateMediaInfo = (arg: MediaInfo) => {
|
||||||
@ -37,9 +37,11 @@ export const updateMediaInfo = (arg: MediaInfo) => {
|
|||||||
mediaInfo.image = propOrDefault(arg.image);
|
mediaInfo.image = propOrDefault(arg.image);
|
||||||
mediaInfo.favorite = arg.favorite;
|
mediaInfo.favorite = arg.favorite;
|
||||||
|
|
||||||
mediaInfo.player.status = propOrDefault(arg.player?.status);
|
mediaInfo.player = {
|
||||||
mediaInfo.player.shuffle = arg.player.shuffle;
|
status: propOrDefault(arg.player?.status),
|
||||||
mediaInfo.player.repeat = propOrDefault(arg.player?.repeat);
|
shuffle: arg.player?.shuffle ?? false,
|
||||||
|
repeat: propOrDefault(arg.player?.repeat),
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user