Ok, here it is briefly.
This is a panes view that shows two media types: Audio and Video. It shows the stats you wanted, each in its own pane.
Here is a selection of Media Type=Audio and one album selected. The stats are updated as you can see:
The code to do this is not difficult, just difficult to read. It requires two components: the rules for file display for the view, and pane entities themselves.
Rules for file display contains two segments: the first initializes the global variables we want to use; the second performs the increments. This works because MC runs each listed rule on the entire current set of files. So when doing this stuff, always think Stage 1: Initialize, Stage 2: Perform work.
Here are the rules split apart for easy reading, and also in the code block for easy copy/paste:
[=save(0,v_ntracks)save(0,v_nalbums)save(0,v_ntracks[album][album artist (auto)])save(0,v_tduration)save(0,v_tsize)1]=1 [=save(math(1+[v_ntracks]),v_ntracks)ifelse(isequal(load(v_ntracks[album][album artist (auto)]),0),save(math(1+[v_nalbums]),v_nalbums))save(math(1+load(v_ntracks[album][album artist (auto)])),v_ntracks[album][album artist (auto)])save(math([duration,0] + [v_tduration]),v_tduration)save(math([file size,0] + [v_tsize]),v_tsize)1]=1
Stage 1. This just initializes each variable we'll use to 0. Note that the v_ntracks[...][...] variable is a unique variable per album/album artist (auto) pairing. This gives us tracks per album, and might need further refinement to uniquely define an album.
[=
save(0,v_ntracks)
save(0,v_nalbums)
save(0,v_ntracks[album][album artist (auto)])
save(0,v_tduration)
save(0,v_tsize)
1]=1
Stage 2: This next stage does the incrementing. It adds 1 to the number of tracks, adds 1 to the number of albums but only for the first track seen for the album, adds 1 to the number of tracks-per-album (which can be used elsewhere, but is not currently being used otherwise), and increments the total file duration and total file size by the file's duration and size respectively.
[=
save(math(1+[v_ntracks]),v_ntracks)
ifelse(isequal(load(v_ntracks[album][album artist (auto)]),0),
save(math(1+[v_nalbums]),v_nalbums)
)
save(math(1+load(v_ntracks[album][album artist (auto)])), v_ntracks[album][album artist (auto)])
save(math([duration,0] + [v_tduration]),v_tduration)
save(math([file size,0] + [v_tsize]),v_tsize)
1]=1
Now, the size pane columns are configured as:
[Media Type]
[Album]
[v_ntracks]
[v_nalbums]
FormatDuration([v_tduration]) : math([v_tduration] / 3600) hours
FormatFileSize([v_tsize]) : [v_tsize] bytes
Note that there is a new feature being employed here. Global variables can now be referenced as if they were fields once they have been defined with a Save() function. So [v_ntracks] is just shorthand for load(v_ntracks). If you don't have MC 18.0.126, replace these pseudo-field entities with the equivalent load() functions, both in the panes expressions and in the Rules for file display.