Fixing adding to playlist upgrade
This commit is contained in:
@ -697,10 +697,14 @@ class ContextMenu extends React.Component {
|
||||
|
||||
list = (
|
||||
<span className="context-menu__item">
|
||||
<span className="context-menu__item mid_grey-text">No writable playlists</span>
|
||||
<span className="context-menu__item mid_grey-text">
|
||||
<span className="context-menu__item__link context-menu__item__link--inactive">
|
||||
No writable playlists
|
||||
</span>
|
||||
</span>
|
||||
</span>
|
||||
);
|
||||
if (playlists.length > 0) {
|
||||
if (playlists.length) {
|
||||
list = playlists.map((playlist) => (
|
||||
<span className="context-menu__item" key={playlist.uri}>
|
||||
<a
|
||||
|
||||
@ -1,6 +1,8 @@
|
||||
|
||||
import React from 'react';
|
||||
import ReactGA from 'react-ga';
|
||||
import { arrayOf } from '../../util/arrays';
|
||||
import URILink from '../../components/URILink';
|
||||
import { uriSource, upgradeSpotifyPlaylistUris } from '../../util/helpers';
|
||||
import {
|
||||
formatTracks,
|
||||
@ -235,7 +237,10 @@ const CoreMiddleware = (function () {
|
||||
break;
|
||||
|
||||
case 'PLAYLIST_TRACKS_ADDED':
|
||||
store.dispatch(uiActions.createNotification({ level: 'warning', content: `Added ${action.tracks_uris.length} tracks to playlist` }));
|
||||
store.dispatch(uiActions.createNotification({
|
||||
level: 'warning',
|
||||
content: <span>Added {action.tracks_uris.length} tracks to <URILink uri={action.key}>playlist</URILink></span>,
|
||||
}));
|
||||
switch (uriSource(action.key)) {
|
||||
case 'spotify':
|
||||
store.dispatch(spotifyActions.getPlaylist(action.key));
|
||||
|
||||
@ -324,9 +324,10 @@ const SnapcastMiddleware = (function () {
|
||||
break;
|
||||
|
||||
case 'SNAPCAST_CALCULATE_GROUP_VOLUME':
|
||||
const totalVolume = action.clients.reduce((accumulator, client) => {
|
||||
return accumulator += formatClient(client).volume;
|
||||
}, 0);
|
||||
const totalVolume = action.clients.reduce((accumulator, client) =>
|
||||
accumulator += formatClient(client).volume,
|
||||
0,
|
||||
);
|
||||
|
||||
store.dispatch(snapcastActions.groupLoaded({
|
||||
id: action.id,
|
||||
|
||||
4
src/js/util/format.js
Normal file → Executable file
4
src/js/util/format.js
Normal file → Executable file
@ -632,8 +632,8 @@ const formatClient = function (data) {
|
||||
client.name = data.config.name;
|
||||
}
|
||||
|
||||
if (data.config.volume) {
|
||||
if (data.config.volume.percent) {
|
||||
if (data.config.volume !== undefined) {
|
||||
if (data.config.volume.percent !== undefined) {
|
||||
client.volume = data.config.volume.percent;
|
||||
}
|
||||
if (data.config.volume.muted) {
|
||||
|
||||
@ -16,18 +16,18 @@ import { sortItems } from '../../util/arrays';
|
||||
class AddToPlaylist extends React.Component {
|
||||
componentDidMount = () => {
|
||||
const {
|
||||
spotify_library_playlists,
|
||||
mopidy_library_playlists,
|
||||
spotify_library_playlists_status,
|
||||
mopidy_library_playlists_status,
|
||||
mopidy_connected,
|
||||
spotifyActions,
|
||||
mopidyActions,
|
||||
} = this.props;
|
||||
|
||||
if (!spotify_library_playlists) {
|
||||
if (!spotify_library_playlists_status || spotify_library_playlists_status !== 'finished') {
|
||||
spotifyActions.getLibraryPlaylists();
|
||||
}
|
||||
|
||||
if (!mopidy_library_playlists && mopidy_connected) {
|
||||
if ((!mopidy_library_playlists_status || mopidy_library_playlists_status !== 'finished') && mopidy_connected) {
|
||||
mopidyActions.getLibraryPlaylists();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user