Subdirectories now route to artist/album/playlist if backend type provided
This commit is contained in:
@ -157986,9 +157986,10 @@ var GridItem = function GridItem(_ref2) {
|
||||
}, [item.images]); // Build link
|
||||
|
||||
var to = '';
|
||||
var getLinkResult = getLink ? getLink(item) : undefined;
|
||||
|
||||
if (getLink) {
|
||||
to = getLink(item);
|
||||
if (getLinkResult) {
|
||||
to = getLinkResult;
|
||||
} else if (item.link) {
|
||||
to = item.link;
|
||||
} else {
|
||||
@ -159127,9 +159128,10 @@ var ListItem = function ListItem(_ref) {
|
||||
|
||||
var onClick = function onClick(e) {
|
||||
var to = '';
|
||||
var getLinkResult = getLink ? getLink(item) : undefined;
|
||||
|
||||
if (getLink) {
|
||||
to = getLink(item);
|
||||
if (getLinkResult) {
|
||||
to = getLinkResult;
|
||||
} else if (item.link) {
|
||||
to = item.link;
|
||||
} else {
|
||||
@ -172345,6 +172347,19 @@ var MopidyMiddleware = function () {
|
||||
loading: true
|
||||
})));
|
||||
subdirectoryImagesToLoad.push(item.uri);
|
||||
} else if (item.__model__ === 'Ref' && item.type === 'artist') {
|
||||
subdirectories.push(Object(_util_format__WEBPACK_IMPORTED_MODULE_6__["formatArtist"])(_objectSpread(_objectSpread({}, item), {}, {
|
||||
loading: true
|
||||
})));
|
||||
subdirectoryImagesToLoad.push(item.uri);
|
||||
} else if (item.__model__ === 'Ref' && item.type === 'playlist') {
|
||||
console.debug('playlist', {
|
||||
item: item
|
||||
});
|
||||
subdirectories.push(Object(_util_format__WEBPACK_IMPORTED_MODULE_6__["formatPlaylist"])(_objectSpread(_objectSpread({}, item), {}, {
|
||||
loading: true
|
||||
})));
|
||||
subdirectoryImagesToLoad.push(item.uri);
|
||||
} else {
|
||||
subdirectories.push(item);
|
||||
}
|
||||
@ -176019,7 +176034,7 @@ function getArtist(uri) {
|
||||
albums = [].concat(_toConsumableArray(albums), _toConsumableArray(Object(_util_format__WEBPACK_IMPORTED_MODULE_3__["formatAlbums"])(response.items)));
|
||||
|
||||
if (response.next) {
|
||||
fetchAlbums(response.next);
|
||||
fetchAlbums("".concat(response.next).concat(forceRefetch ? "&refetch=".concat(Date.now()) : ''));
|
||||
} else {
|
||||
dispatch(coreActions.itemLoaded({
|
||||
uri: uri,
|
||||
@ -176138,7 +176153,7 @@ function getUser(uri) {
|
||||
playlists = [].concat(_toConsumableArray(playlists), _toConsumableArray(Object(_util_format__WEBPACK_IMPORTED_MODULE_3__["formatPlaylists"])(response.items)));
|
||||
|
||||
if (response.next) {
|
||||
fetchPlaylists(response.next);
|
||||
fetchPlaylists("".concat(response.next).concat(forceRefetch ? "&refetch=".concat(Date.now()) : ''));
|
||||
} else {
|
||||
dispatch(coreActions.itemLoaded({
|
||||
uri: uri,
|
||||
@ -176193,7 +176208,7 @@ function getAlbum(uri) {
|
||||
tracks = [].concat(_toConsumableArray(tracks), _toConsumableArray(Object(_util_format__WEBPACK_IMPORTED_MODULE_3__["formatTracks"])(response.items)));
|
||||
|
||||
if (response.next) {
|
||||
fetchTracks(response.next);
|
||||
fetchTracks("".concat(response.next).concat(forceRefetch ? "&refetch=".concat(Date.now()) : ''));
|
||||
} else {
|
||||
dispatch(coreActions.itemLoaded({
|
||||
uri: uri,
|
||||
@ -176341,7 +176356,7 @@ function getPlaylistTracks(uri) {
|
||||
tracks = [].concat(_toConsumableArray(tracks), _toConsumableArray(Object(_util_format__WEBPACK_IMPORTED_MODULE_3__["formatTracks"])(response.items)));
|
||||
|
||||
if (response.next) {
|
||||
fetchTracks(response.next);
|
||||
fetchTracks("".concat(response.next).concat(forceRefetch ? "&refetch=".concat(Date.now()) : ''));
|
||||
} else {
|
||||
dispatch(coreActions.itemLoaded({
|
||||
uri: uri,
|
||||
@ -187623,6 +187638,7 @@ var DiscoverCategories = /*#__PURE__*/function (_React$Component) {
|
||||
getLink: function getLink(item) {
|
||||
return "/discover/categories/".concat(Object(_util_format__WEBPACK_IMPORTED_MODULE_9__["encodeUri"])(item.uri));
|
||||
},
|
||||
sourceIcon: false,
|
||||
"data-qa-node": "Grid",
|
||||
"data-qa-file": "DiscoverCategories"
|
||||
})));
|
||||
@ -190100,8 +190116,7 @@ var LibraryBrowse = /*#__PURE__*/function (_React$Component) {
|
||||
_defineProperty(_assertThisInitialized(_this), "render", function () {
|
||||
var _this$props = _this.props,
|
||||
loading = _this$props.loading,
|
||||
directory = _this$props.directory,
|
||||
mopidyActions = _this$props.mopidyActions;
|
||||
directory = _this$props.directory;
|
||||
|
||||
if (!directory) {
|
||||
if (loading) {
|
||||
@ -190366,10 +190381,10 @@ var Breadcrumbs = function Breadcrumbs(_ref) {
|
||||
var Subdirectories = function Subdirectories(_ref2) {
|
||||
var items = _ref2.items,
|
||||
view = _ref2.view;
|
||||
if (!items.length) return null;
|
||||
if (!items.length) return null; // Only define the link for directories; allows URILink to intelligently route based on type
|
||||
|
||||
var link = function link(item) {
|
||||
return "/library/browse/".concat(encodeURIComponent(item.name), "/").concat(Object(_util_format__WEBPACK_IMPORTED_MODULE_19__["encodeUri"])(item.uri));
|
||||
return item.type === 'directory' ? "/library/browse/".concat(encodeURIComponent(item.name), "/").concat(Object(_util_format__WEBPACK_IMPORTED_MODULE_19__["encodeUri"])(item.uri)) : null;
|
||||
};
|
||||
|
||||
if (view === 'list') {
|
||||
|
||||
File diff suppressed because one or more lines are too long
6
mopidy_iris/static/app.min.js
vendored
6
mopidy_iris/static/app.min.js
vendored
File diff suppressed because one or more lines are too long
@ -115,7 +115,7 @@
|
||||
|
||||
// Release details
|
||||
// These are automatically injected to built HTML
|
||||
var build = "1619601071";
|
||||
var build = "1619686814";
|
||||
var version = "3.57.6";
|
||||
|
||||
// Construct the script tag
|
||||
|
||||
Reference in New Issue
Block a user