Adding generic loadItem (refactor elsewhere); Adding foundation for Add Random

This commit is contained in:
James Barnsley
2020-08-03 07:08:16 +12:00
parent 8824d7a5d6
commit e398949a06
14 changed files with 690 additions and 460 deletions

View File

@ -3,7 +3,7 @@ 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 { uriSource, upgradeSpotifyPlaylistUris, uriType, titleCase } from '../../util/helpers';
import {
formatTracks,
formatTrack,
@ -315,12 +315,18 @@ const CoreMiddleware = (function () {
break;
/**
* Asset Load commands
*
* These are called from views and other middleware to load
* assets. This is where we can return already indexed records
* where appropriate
* */
* Asset Load commands
*
* These are called from views and other middleware to load
* assets. This is where we can return already indexed records
* where appropriate
* */
case 'LOAD_ITEM':
store.dispatch(coreActions[`load${titleCase(uriType(action.uri))}`](
action.uri,
action.force_reload,
));
break;
case 'LOAD_TRACK':
if (