Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions MaterialSkin/HTML/material/html/js/browse-page.js
Original file line number Diff line number Diff line change
Expand Up @@ -645,7 +645,7 @@ var lmsBrowse = Vue.component("lms-browse", {
if (stdItem==STD_ITEM_WORK) {
return undefined!=this.current.composer ? this.current.composer : this.current.subtitle;
}
if (stdItem==STD_ITEM_ALBUM || stdItem==STD_ITEM_ALL_TRACKS || stdItem==STD_ITEM_COMPOSITION_TRACKS || stdItem==STD_ITEM_MIX || stdItem==STD_ITEM_CLASSICAL_WORKS) {
if (stdItem==STD_ITEM_ALBUM || stdItem==STD_ITEM_ALL_TRACKS || stdItem==STD_ITEM_COMPOSITION_TRACKS || stdItem==STD_ITEM_MIX || stdItem==STD_ITEM_CLASSICAL_WORKS || stdItem==STD_ITEM_ONLINE_ALBUM) {
let albumArtst = this.current.subIsYear ? undefined : this.current.subtitle;
if (lmsOptions.noArtistFilter && this.current.compilation && this.items.length>0 && undefined!=this.items[0].compilationAlbumArtist) {
albumArtst = this.items[0].compilationAlbumArtist;
Expand All @@ -669,7 +669,7 @@ var lmsBrowse = Vue.component("lms-browse", {
return false;
}
let stdItem = this.current.stdItem ? this.current.stdItem : this.current.altStdItem;
if (stdItem==STD_ITEM_ARTIST || stdItem==STD_ITEM_WORK_COMPOSER || stdItem==STD_ITEM_WORK || stdItem==STD_ITEM_CLASSICAL_WORKS) {
if (stdItem==STD_ITEM_ARTIST || stdItem==STD_ITEM_WORK_COMPOSER || stdItem==STD_ITEM_WORK || stdItem==STD_ITEM_CLASSICAL_WORKS || stdItem==STD_ITEM_ONLINE_ALBUM) {
return this.headerSubTitle
}
if (stdItem==STD_ITEM_ALBUM || stdItem==STD_ITEM_MIX || stdItem==STD_ITEM_ALL_TRACKS || stdItem==STD_ITEM_COMPOSITION_TRACKS) {
Expand Down
13 changes: 12 additions & 1 deletion MaterialSkin/HTML/material/html/js/browse-resp.js
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ function parseBrowseResp(data, parent, options, cacheKey, parentCommand, parentG
var maybeAllowGrid = command!="trackstat"; // && !isFavorites; // && command!="playhistory";
var numImages = 0;
var numTracks = 0;
var totalDuration = 0; // support for total duration if duration has been passed as a parameter

resp.isMusicMix = MIXER_APPS.has(command) && data.params[1].length>0 && (data.params[1][1]=="mix" || data.params[1][1]=="list");
resp.canUseGrid = maybeAllowGrid && (isRadiosTop || isAppsTop || isBmf || isDisksAndFolders || (data.result.window && data.result.window.windowStyle && (data.result.window.windowStyle=="icon_list" || data.result.window.windowStyle=="home_menu"))) ? true : false;
Expand Down Expand Up @@ -693,7 +694,12 @@ function parseBrowseResp(data, parent, options, cacheKey, parentCommand, parentG
i.icon = undefined;
haveWithoutIcons = true;
}


// show duration if duration has been passed as a parameter
i.duration = parseFloat(i.duration || 0);
i.durationStr = i.duration>0 ? formatSeconds(i.duration) : undefined,
totalDuration += i.duration>0 ? i.duration : 0;

resp.items.push(i);
// If this is a "text" item with an image then treat as a standard actionable item
if ("text"==i.type && (undefined!=i.image || undefined!=i.icon || undefined!=i.svg)) {
Expand Down Expand Up @@ -929,6 +935,11 @@ function parseBrowseResp(data, parent, options, cacheKey, parentCommand, parentG
}
}
}

// show total duration if duration has been passed as a parameter
if (totalDuration>0) {
resp.subtitle+=SEPARATOR+formatSeconds(totalDuration);
}
} else if (data.result.artists_loop) {
var type = 0;
var stdItem = parent && parent.id.startsWith("mmw") ? STD_ITEM_WORK_COMPOSER : STD_ITEM_ARTIST;
Expand Down