mirror of
https://github.com/jellyfin/jellyfin-web.git
synced 2024-11-23 05:59:54 +00:00
Simplify play target sorting
This commit is contained in:
parent
bc7ec0e876
commit
ca7311cb08
@ -65,17 +65,20 @@ const RemotePlayMenu: FC<RemotePlayMenuProps> = ({
|
|||||||
open={open}
|
open={open}
|
||||||
onClose={onMenuClose}
|
onClose={onMenuClose}
|
||||||
>
|
>
|
||||||
{!isChromecastPluginLoaded && ([
|
{!isChromecastPluginLoaded && (
|
||||||
<MenuItem key='cast-unsupported-item' disabled>
|
<MenuItem disabled>
|
||||||
<ListItemIcon>
|
<ListItemIcon>
|
||||||
<Warning />
|
<Warning />
|
||||||
</ListItemIcon>
|
</ListItemIcon>
|
||||||
<ListItemText>
|
<ListItemText>
|
||||||
{globalize.translate('GoogleCastUnsupported')}
|
{globalize.translate('GoogleCastUnsupported')}
|
||||||
</ListItemText>
|
</ListItemText>
|
||||||
</MenuItem>,
|
</MenuItem>
|
||||||
<Divider key='cast-unsupported-divider' />
|
)}
|
||||||
])}
|
|
||||||
|
{!isChromecastPluginLoaded && playbackTargets.length > 0 && (
|
||||||
|
<Divider />
|
||||||
|
)}
|
||||||
|
|
||||||
{playbackTargets.map(target => (
|
{playbackTargets.map(target => (
|
||||||
<MenuItem
|
<MenuItem
|
||||||
|
@ -852,17 +852,8 @@ export class PlaybackManager {
|
|||||||
self.getTargets = function () {
|
self.getTargets = function () {
|
||||||
const promises = players.filter(displayPlayerIndividually).map(getPlayerTargets);
|
const promises = players.filter(displayPlayerIndividually).map(getPlayerTargets);
|
||||||
|
|
||||||
return Promise.all(promises).then(function (responses) {
|
return Promise.all(promises)
|
||||||
const targets = [];
|
.then(responses => responses.flat().sort(sortPlayerTargets));
|
||||||
|
|
||||||
for (const subTargets of responses) {
|
|
||||||
for (const subTarget of subTargets) {
|
|
||||||
targets.push(subTarget);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return targets.sort(sortPlayerTargets);
|
|
||||||
});
|
|
||||||
};
|
};
|
||||||
|
|
||||||
self.playerHasSecondarySubtitleSupport = function (player = self._currentPlayer) {
|
self.playerHasSecondarySubtitleSupport = function (player = self._currentPlayer) {
|
||||||
|
Loading…
Reference in New Issue
Block a user