INTERACT FORUM

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1]   Go Down

Author Topic: Total tracks in multi-disc albums?  (Read 8076 times)

newHAPPYuser2015

  • World Citizen
  • ***
  • Posts: 111
Total tracks in multi-disc albums?
« on: September 15, 2015, 11:54:47 am »

Is there a way to make MC display total tracks in multi-disc albums as an actual total number of tracks in an album rather than average number of tracks per disc?

Thanks
Logged

blgentry

  • Regular Member
  • Citizen of the Universe
  • *****
  • Posts: 8014
Re: Total tracks in multi-disc albums?
« Reply #1 on: September 15, 2015, 12:40:05 pm »

[Total Tracks] is a field for every song (file) in MC.  If you only have a few of these, just figure out the total number of tracks and set [Total Tracks] to that value for all the songs in the album.  Done!  :)

If you're not aware, you can set the value on all the songs in an album at once.  Just highlight them, open the tagging pane, and paste in the value you want for Total Tracks.

I used to have LOTS of albums that didn't have Total Tracks filled out at all.   I did some research and found a thread that outlined a method for how to calculate Total Tracks on each album.  Thread is here:

http://yabb.jriver.com/interact/index.php?topic=85233.0

I had to do some reading and experimentation to make it work, but I got it done.  MY version calculates Total Tracks for each Disc in an album.  It's very easy to have it calculate for the entire album though.  It's a minor change to the expression.

Depending on what you want to do, I (or someone else here) may be able to help you out.

Brian.
Logged

newHAPPYuser2015

  • World Citizen
  • ***
  • Posts: 111
Re: Total tracks in multi-disc albums?
« Reply #2 on: September 15, 2015, 02:17:16 pm »

MY version calculates Total Tracks for each Disc in an album.  It's very easy to have it calculate for the entire album though.  It's a minor change to the expression.
blgentry, could you please share the expression? Not sure if I need it though :)

What I need total number of songs in an album for is to use ''Compare()'' function to compare total number to a number of songs I have so I could see which albums are complete and which are not.

If I create a custom library field can I somehow populate it (fast) with values from default ''total tracks'' field? (and then manually edit tags for multi-disc albums)
Logged

blgentry

  • Regular Member
  • Citizen of the Universe
  • *****
  • Posts: 8014
Re: Total tracks in multi-disc albums?
« Reply #3 on: September 15, 2015, 04:52:29 pm »

I'm confused as to what you are trying to do and how you want to do it.

The expressions I mentioned, which are part of a View you create, just *count* tracks and total them up.  They don't know the "official" number of tracks, so they wouldn't be any basis for determining if an album is complete or not.  Did you know that MC has a built in way of trying to identify complete albums?

It uses some heuristics to try to figure it out and automatically populates a field called [Complete Album].  If it's a 1, it's complete.  If it's blank, MC thinks the album is incomplete.  You can build a smartlist that shows only albums with [Complete Album]=0 to find what MC thinks are incomplete albums.  There's a built in smartlist for this under Playlists > Smarlists > Audio - Tasks - Incomplete Albums .

If you can outline, more specifically, what you are tying to do, and how you are trying to get there, we might be able to help you.

Good luck.

Brian.
Logged

newHAPPYuser2015

  • World Citizen
  • ***
  • Posts: 111
Re: Total tracks in multi-disc albums?
« Reply #4 on: September 15, 2015, 05:08:32 pm »

If you can outline, more specifically, what you are tying to do, and how you are trying to get there, we might be able to help you.

Is there an expression that will show total number of tracks in an album? For example if an album has 6 tracks on disc 1 and 5 tracks on disc 2 it would show that this album has 11 tracks, not 5.5 like built-in 'total tracks' field does. Manually editing total tracks tag would work - I am just not sure I want to change these tags, so I was wandering if there are other ways to achieve that.
Logged

blgentry

  • Regular Member
  • Citizen of the Universe
  • *****
  • Posts: 8014
Re: Total tracks in multi-disc albums?
« Reply #5 on: September 15, 2015, 05:29:03 pm »

The post I linked to above has details on how to do that.  But I'll try to save you some of the effort and give you an expression I've used to do this.

Create a new SmartList or View.  I'm going to give you an expression below to paste in.  For a Smartlist, you paste this into the Import/Export box when Editing it.  For a view, you go to Customize View > Settings > Included Files > Set rules for file display.  There will be an Import/Export box there too.

Here's the expression to use:

Code: [Select]
[Media Type]=[Audio] [Total Discs]=>1 [=save(0,v_tracks[album artist (auto)][album])1]=1 [=save(math(1+load(v_tracks[album artist (auto)][album])),v_tracks[album artist (auto)][album])1]=1
This will select all albums with more than 1 disc listed in total discs.  If your multi-disc albums don't have this, you can use some other criteria to try to identify them. The rest of the expression is the important part.

Now, go into your smartlist or View and add an expression column.  I call mine "Tracks per Album".  In the expression area, paste in this expression:

Code: [Select]
load(v_tracks[album artist (auto)][album])
Now that column will show you total tracks, across all discs, per album.  If you want to set a field to use this value, you can paste in the expression, with an = in front of it, and it will fill in the right number in that field.

I hope this helps.

Brian.
Logged

ferday

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 1732
Re: Total tracks in multi-disc albums?
« Reply #6 on: September 15, 2015, 08:01:48 pm »

The built in total tracks field doesn't display anything that isn't already there, it's NOT a calculated field

(It will never display 5.5 unless you put it in there, and it's an integer field so it'll never display 5.5 ever)

The expression Blgentry posted will calculate total tracks per album name/artist name Combination.  This means it depends on how you name your albums...I name mine the same (for example, nirvana nevermind disc 2 is just named nevermind, with disc # set to two). 

The expression will calculate total tracks for the whole album, for all the discs if named this way.  I hope this makes sense....
Logged

newHAPPYuser2015

  • World Citizen
  • ***
  • Posts: 111
Re: Total tracks in multi-disc albums?
« Reply #7 on: September 16, 2015, 03:31:06 am »

(It will never display 5.5 unless you put it in there, and it's an integer field so it'll never display 5.5 ever)
I suppose I should have clarified - I am talking about a library view set up as ''categories'', with category ''album'' and list style ''details''. In this case ''total tracks'' will show fractional numbers as well (average 'total tracks'' per disc).

The post I linked to above has details on how to do that.  But I'll try to save you some of the effort and give you an expression I've used to do this.

Create a new SmartList or View.  I'm going to give you an expression below to paste in.  For a Smartlist, you paste this into the Import/Export box when Editing it.  For a view, you go to Customize View > Settings > Included Files > Set rules for file display.  There will be an Import/Export box there too.

Here's the expression to use:

Code: [Select]
[Media Type]=[Audio] [Total Discs]=>1 [=save(0,v_tracks[album artist (auto)][album])1]=1 [=save(math(1+load(v_tracks[album artist (auto)][album])),v_tracks[album artist (auto)][album])1]=1
This will select all albums with more than 1 disc listed in total discs.  If your multi-disc albums don't have this, you can use some other criteria to try to identify them. The rest of the expression is the important part.

Now, go into your smartlist or View and add an expression column.  I call mine "Tracks per Album".  In the expression area, paste in this expression:

Code: [Select]
load(v_tracks[album artist (auto)][album])
Now that column will show you total tracks, across all discs, per album.  If you want to set a field to use this value, you can paste in the expression, with an = in front of it, and it will fill in the right number in that field.

I hope this helps.

Brian.
Unless I botched something, doesn't your expression behave exactly same way as ''track#''(in a view I described above), i.e. shows total number of tracks one owns from a particular album?
UPDATE: Now I get it. This expression came in handy for creating a custom library field.


One question that remains
Example:
- an album has 2 discs
- 6 tracks on disc 1 and 5 tracks on disc 2
- I have in my collection, let's say, 4 tracks from disc 1 and 3 tracks from disc 2

I would like an expression to show that this album has 11 tracks in total - not 7 that I own and not the average number per disc (5.5) - i.e. I would like it to sum total tracks per disc. Is it possible? If it is not I guess i'll have to settle for changing ''total tracks'' tag of each song in multi-disc albums to the same value regardless of disc#.
Logged

blgentry

  • Regular Member
  • Citizen of the Universe
  • *****
  • Posts: 8014
Re: Total tracks in multi-disc albums?
« Reply #8 on: September 16, 2015, 08:26:16 am »

I suppose I should have clarified - I am talking about a library view set up as ''categories'', with category ''album'' and list style ''details''. In this case ''total tracks'' will show fractional numbers as well (average 'total tracks'' per disc).

Ok, I see what you are seeing now.  That's strange that it does it that way.  But it's also very unusual to be using a categories view in Details mode.  Have you tried a similar view in Panes?

Either way, if you like that view, you can fix this by making [Total Tracks] be the same for all songs in that album, and making it the sum total of tracks across all discs.  So, in your example of disc 1 with 6 tracks and disc 2 with 5 tracks, you set Total Tracks to 11 for ALL songs in that album (all 11 of them).  Then Total Tracks will display 11 as you'd expect.  Or, if you really wanted to, you could do a custom field like [Total Tracks (album)] or whatever you want to call it, and display that as a column in your details view.

Quote
One question that remains
Example:
- an album has 2 discs
- 6 tracks on disc 1 and 5 tracks on disc 2
- I have in my collection, let's say, 4 tracks from disc 1 and 3 tracks from disc 2

I would like an expression to show that this album has 11 tracks in total - not 7 that I own and not the average number per disc (5.5) - i.e. I would like it to sum total tracks per disc. Is it possible? If it is not I guess i'll have to settle for changing ''total tracks'' tag of each song in multi-disc albums to the same value regardless of disc#.

You can fill in "11" for Total Tracks and then it will show 11 in all views that show Total Tracks.  But are you asking for MC to go figure out that the Album has 11 tracks, when you only have 7 in your library?  If that's what you want, I don't know a way of doing it inside of MC  I said so several posts up.  If *you* know that information, then simply type it in to either the Total Tracks field, or a custom field that you make to hold that information.  Or am I missing what you are trying to ask?

Brian.
Logged

newHAPPYuser2015

  • World Citizen
  • ***
  • Posts: 111
Re: Total tracks in multi-disc albums?
« Reply #9 on: September 16, 2015, 09:06:59 am »

Ok, I see what you are seeing now.  That's strange that it does it that way.  But it's also very unusual to be using a categories view in Details mode.  Have you tried a similar view in Panes?
I haven't. Panes always list songs, don't they? I like ''categories'' view for albums because it's a concise way of displaying relevant information about albums without extra clutter.

But are you asking for MC to go figure out that the Album has 11 tracks, when you only have 7 in your library?
I don't expect it to be omniscient :) It knows what disc# songs in an album belong to and it knows how much songs each disc that I have songs from is supposed to have (total tracks). So I was wondering if maybe there is a way through an expression to sum total tracks from each disc for each album. After all MC already does more than that by showing average number for multi-disc albums.
Logged

blgentry

  • Regular Member
  • Citizen of the Universe
  • *****
  • Posts: 8014
Re: Total tracks in multi-disc albums?
« Reply #10 on: September 16, 2015, 09:34:43 am »

I haven't. Panes always list songs, don't they? I like ''categories'' view for albums because it's a concise way of displaying relevant information about albums without extra clutter.

You might like Panes set up a certain way.   Or not.  Give it a try like this:  Set up some Panes with values that are relevant to you:  Album, Artist, Genre... whatever you like.  Then stretch the horizontal divider very far down, so the actual Panes take up most of the vertical area.  Now you'll have a very detailed way of finding your music, with the songs down below once you want to focus on them.  <shrug>  Maybe you'll like it, maybe not.  That's the power and beauty of MC:  It can be set up in so many different ways to suit individual needs.

Quote
I don't expect it to be omniscient :) It knows what disc# songs in an album belong to and it knows how much songs each disc that I have songs from is supposed to have (total tracks).

Stop there for a second.  Your Total Tracks field is correct for all individual discs, even those discs that you don't have all of the songs for?  So on Disc 1, which is supposed to have 6 tracks, and you only have 3 of them, Total Tracks is 6 for all songs?  If so, I get what you're asking for.  An expression to sum [Total Tracks] for Disc 1 through Disk N for each album with more than one disc.  Hmmm...  That would take something fancy; probably something with global variables.  There are people here who could figure it out for sure.  I don't have an answer for that right now.

Brian.
Logged

newHAPPYuser2015

  • World Citizen
  • ***
  • Posts: 111
Re: Total tracks in multi-disc albums?
« Reply #11 on: September 16, 2015, 09:53:42 am »

You might like Panes set up a certain way.   Or not.  Give it a try like this:  Set up some Panes with values that are relevant to you:  Album, Artist, Genre... whatever you like.  Then stretch the horizontal divider very far down, so the actual Panes take up most of the vertical area.  Now you'll have a very detailed way of finding your music, with the songs down below once you want to focus on them.  <shrug>  Maybe you'll like it, maybe not.  That's the power and beauty of MC:  It can be set up in so many different ways to suit individual needs.
Oh, I just didn't express myself well. I have several views with panes. It's just that that specific view for albums is set up as ''categories'' view and I quite like it that way.

Stop there for a second.  Your Total Tracks field is correct for all individual discs, even those discs that you don't have all of the songs for?  So on Disc 1, which is supposed to have 6 tracks, and you only have 3 of them, Total Tracks is 6 for all songs?  If so, I get what you're asking for. An expression to sum [Total Tracks] for Disc 1 through Disk N for each album with more than one disc.  Hmmm...  That would take something fancy; probably something with global variables.  There are people here who could figure it out for sure.  I don't have an answer for that right now.

Brian.
I think you understand what I would like to achieve.
Logged

blgentry

  • Regular Member
  • Citizen of the Universe
  • *****
  • Posts: 8014
Re: Total tracks in multi-disc albums?
« Reply #12 on: September 16, 2015, 11:24:57 am »

Ok, I've got a working solution for you, but it's pretty complicated.  To do this, you need to build a smartlist and a View.  They work together.

1.  Smartlist:  Discs 2 or more, limited .  This gets you every song from every album in your library that has 2 or more discs, then limits it down to one track from each Disc in each Album. Import/Export code:

Code: [Select]
[Media Type]=[Audio] [Disc #]=>=2 ~a ~limit=-1,1,[Album],[Disc #] ~sort=[Album Artist (auto)],[Album],[Disc #]
2.  View to calculate Total Tracks per Album .  The code below will do all of the calculation work for you.  In the code below, you'll see a SmartList ID number.  Replace this with the ID number of Smartlist #1 on your system.  You can choose this graphically, after you close the Import/Export dialog.  You should see "Playlist is any" and then a blank.   Pull down the blank to choose your Smartlist  Here's the Import/Export code:

Code: [Select]
[Media Type]=[Audio] playlistid==788130232 [=save(0,v_atracks[album artist (auto)][album])1]=1 [=save(math([Total Tracks]+load(v_atracks[album artist (auto)][album])),v_atracks[album artist (auto)][album])1]=1
Once the View is built, you need to add a column to show the Tracks per Album.  Here's what you'll paste into an expression column to show that value:

Code: [Select]
load(v_atracks[album artist (auto)][album])
This works correctly on my system, but I don't have any multi-disc albums that are missing tracks.  The logic should work on your system too, but you'll have to test it to be sure.

Let me know how it works for you.

Brian.
Logged

blgentry

  • Regular Member
  • Citizen of the Universe
  • *****
  • Posts: 8014
Re: Total tracks in multi-disc albums?
« Reply #13 on: September 16, 2015, 11:36:25 am »

Edited the post above to make it a little bit easier.

Brian.
Logged

newHAPPYuser2015

  • World Citizen
  • ***
  • Posts: 111
Re: Total tracks in multi-disc albums?
« Reply #14 on: September 16, 2015, 12:23:52 pm »

Thanks, blgentry. It works.

I have one question, though. Can this expression
 load(v_atracks[album artist (auto)][album])
be modified somehow so it would work for single disc albums as well? Right now it sums total tracks for each disc in multi-disc albums just as I wanted. Can it be modified so it would also output total tracks for single cd albums?
Logged

blgentry

  • Regular Member
  • Citizen of the Universe
  • *****
  • Posts: 8014
Re: Total tracks in multi-disc albums?
« Reply #15 on: September 16, 2015, 05:17:19 pm »

Thanks, blgentry. It works.

I have one question, though. Can this expression
 load(v_atracks[album artist (auto)][album])
be modified somehow so it would work for single disc albums as well? Right now it sums total tracks for each disc in multi-disc albums just as I wanted. Can it be modified so it would also output total tracks for single cd albums?

The expression in the View above is driven by the [Total Tracks] field.  It adds those up for every disc in a multi-disc album.  For a SINGLE disc album, the total tracks are just the number in the [Total Tracks] field.  There's nothing to calculate.

If you wanted to see that in the same view, you could remove the restriction at the top of the SmartList of "[DIsc #]=>=2".  That way you'd get all Albums no matter how many discs.  It *should* do the calculation correctly, but I haven't tested it.

Again, it will just use the [Total Tracks] field.

Brian.
Logged
Pages: [1]   Go Up