INTERACT FORUM

More => Old Versions => Media Center 17 => Topic started by: audioriver on July 29, 2012, 06:53:37 am

Title: Display: 2-digit track numbers and total album tracks possible?
Post by: audioriver on July 29, 2012, 06:53:37 am
Is it possible to display 2-digit numbers as the track number without altering it? MC seems to force 1-digit, even if the tag is actually a 2-digit.
Also, is it possible to display the total playing album tracks, instead of PN tracks? Thanks.
Title: Re: Display: 2-digit track numbers and total album tracks possible?
Post by: MrC on July 29, 2012, 10:19:19 am
Use an expression column in your view instead of just viewing the field Track #, as in:

   PadNumber([Track #], 2)

See this post for examples:

  http://yabb.jriver.com/interact/index.php?topic=71679.msg484203#msg484203 (http://yabb.jriver.com/interact/index.php?topic=71679.msg484203#msg484203)
Title: Re: Display: 2-digit track numbers and total album tracks possible?
Post by: audioriver on July 29, 2012, 10:42:03 am
Thanks MrC. Any clues on the album tracks number for displaying something like: "PadNumber([Track #], 2) of [AlbumTracks]" ?
Title: Re: Display: 2-digit track numbers and total album tracks possible?
Post by: rick.ca on July 29, 2012, 04:33:53 pm
Do this: HOWTO: Generate album ratings using variables (+ track count) (http://yabb.jriver.com/interact/index.php?topic=72049.msg487368#msg487368) and then use the 'v_tracks...' variable for [AlbumTracks].
Title: Re: Display: 2-digit track numbers and total album tracks possible?
Post by: audioriver on July 31, 2012, 08:41:40 am
Thanks rick.ca, however it's a bit too complicated for me, for such a simple requirement. Am I supposed to create a smartlist, use import/export, create a new expression column (AlbumTracks for example) and somehow use v_tracks to make AlbumTracks usable in the display? I don't know how to do all this.  :(

The import/export string in that thread totally confused me.
Title: Re: Display: 2-digit track numbers and total album tracks possible?
Post by: rick.ca on July 31, 2012, 02:27:08 pm
Quote
Thanks rick.ca, however it's a bit too complicated for me, for such a simple requirement.

It's not complicated—just follow the directions. The 'import' simply refers to the process of copying the expression provided and pasting into the smartlist dialog, as the attached illustrates. Using the expression in a view (e.g., by incorporating the smartlist created into it's Rules for file display) will result in the number of tracks in each album in the view being calculated. That value for any particular album will be v_tracks[album artist (auto)][album]. Use that directly (e.g., in an expression column) or save it as an expression field, and use that.
Title: Re: Display: 2-digit track numbers and total album tracks possible?
Post by: audioriver on August 01, 2012, 03:46:30 am
Thanks again. Please understand I haven't got a clue on how expression fields/columns etc. work, never used anything like that, let alone for media player uses. I tried to make it work but couldn't, so I'll probably need idiot-proof steps.

1. Add smartlist
2. Name it "Album Tracks"
3. Import/Export, paste the following text exactly as it is (copied from the other thread):

Quote
[Media Type]=[Audio] [=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 [=save(0,v_albumratingsum[album artist (auto)][album])1]=1 [=if(compare([rating],=,0),save(-1,v_albumratingsum[album artist (auto)][album]),)1]=1 [=if(compare(load(v_albumratingsum[album artist (auto)][album]),>,-1),save(math([rating]+load(v_albumratingsum[album artist (auto)][album])),v_albumratingsum[album artist (auto)][album]),)1]=1 ~sort=[Album Artist (auto)],[Album],[Track #],[Media Type],[Disc #],[Name]

We now have this new smartlist and here I get stuck. I tried "Add expression column", named it "Album Tracks" then "Insert Function" and pasted

Quote
if(compare(load(v_albumratingsum[album artist (auto)][album]),>,0),formatnumber(math( load(v_albumratingsum[album artist (auto)][album]) / load(v_tracks[album artist (auto)][album]) ),2),0)]

Are these steps correct? Probably not, since I get an Album Tracks column displaying only zeroes. Also tried pasting only "v_tracks[album artist (auto)][album]" but that didn't work either. And of course putting "v_tracks[album artist (auto)][album]" or "[Album Track]" on "Customize Display" didn't work (all without the quotes).
Title: Re: Display: 2-digit track numbers and total album tracks possible?
Post by: rick.ca on August 01, 2012, 04:06:41 pm
Quote
Are these steps correct? Probably not, since I get an Album Tracks column displaying only zeroes.

No. The original instructions are clear, so it's best I refer directly to those. Bear in mind their purpose is to calculate the average track rating per album, but in order to do so the number of tracks per album must be determined. I assumed you would have no objection to having both, since the solution has already been created.

[edited for clarity]
So for instance, in my system I have a smartlist called Var: Album Ratings that calculates the ratings as per my example above.

Then in a view that wished to use album ratings I would use this smartlist as part of the Rules for file display:

Playlists is any Var: Album Ratings [NB: Each of these three values are selected from drop-down boxes]
<rest of the rules>

This ensures that the ratings are created and can be used by the view.

The Rules for file display are at Customize View > Settings > Included Files. Including this rule requires the smartlist to be calculated, making the global variables (including the number of tracks per album) to be calculated. If it's not calculated, the value of all the variables will appear to be '0' (in fact, they don't exist).

Add an expression column 'Album Rating'

if(compare(load(v_albumratingsum[album artist (auto)][album]),>,0),formatnumber(math( load(v_albumratingsum[album artist (auto)][album]) / load(v_tracks[album artist (auto)][album]) ),2),0)

where

v_albumratingsum[album artist (auto)][album] is the variable that holds the album average, or -1 if tracks remain unvoted for.
v_tracks[album artist (auto)][album] contains the number of tracks in the album.

For the number of tracks per album, all you need is the last bit. To put that in an expression column or expression field, enter Load(v_tracks[album artist (auto)][album]) directly into the respective expression edit box. It's not a field or function to be 'inserted'.
Title: Re: Display: 2-digit track numbers and total album tracks possible?
Post by: audioriver on August 02, 2012, 03:55:39 am
Maybe getting closer but not quite.

1. Create a "Var: Album Ratings" smartlist.
2. Import/Export, paste the text exactly as it is (copied from the other thread), press ok creating the smartlist with no other option modifications.
3. Customize View/Set Rules for file display/Playlists.is any.Smartlists\Var: Album Ratings.
4. Columns/Add expression column - name it Album Tracks and paste this in the expression editor: v_tracks[album artist (auto)][album]

Something wrong again...
Title: Re: Display: 2-digit track numbers and total album tracks possible?
Post by: struct on August 02, 2012, 05:55:54 am

I just tried to do the same...

on your last line (point 4) try wrapping it in load(); e.g load(v_tracks[album artist (auto)][album])

seems to work.
Title: Re: Display: 2-digit track numbers and total album tracks possible?
Post by: audioriver on August 02, 2012, 06:30:37 am
Thanks struct, that did the trick - and thanks to rick.ca for persevering.
Title: Re: Display: 2-digit track numbers and total album tracks possible?
Post by: struct on August 02, 2012, 08:00:47 am

I can't figure out how to use the track count in a smartlist or view.   I was trying to limit my album view to only those albums that contained 5 or more tracks.  I can see the album count in a column, but not sure how to put it into a rules for file display?  Any suggestions.

Thanks
Title: Re: Display: 2-digit track numbers and total album tracks possible?
Post by: rick.ca on August 02, 2012, 05:40:59 pm
on your last line (point 4) try wrapping it in load()

Yes. Sorry, it doesn't work very well without the Load(). :-[

Bear in mind global variables can only be created for the current session using Save() and recalled using Load(). Like other such expressions where the same variable may be used in a variety of ways, it might be helpful to save it as an expression field. '[Number Tracks]' is easier to work with than 'load(v_tracks[album artist (auto)][album])'.

I can't figure out how to use the track count in a smartlist or view.   I was trying to limit my album view to only those albums that contained 5 or more tracks.  I can see the album count in a column, but not sure how to put it into a rules for file display?  Any suggestions.

I can't explain this, other than to note there are other situations where it's necessary to save an expression as an expression field, and then use that instead of the expression. But this goes beyond that. The expression field [Number Tracks] will work in a Search, but it's treated as a string rather than an integer. Therefore (I suppose), it still can't be used in a Compare(). It's rather awkward, but values can still be selected individually (e.g., -[Number Tracks]=[1],[2],[3],[4],[5] ). Maybe I'm missing something... :-\
Title: Re: Display: 2-digit track numbers and total album tracks possible?
Post by: MrC on August 02, 2012, 07:13:13 pm
I can't figure out how to use the track count in a smartlist or view.   I was trying to limit my album view to only those albums that contained 5 or more tracks.  I can see the album count in a column, but not sure how to put it into a rules for file display?  Any suggestions.

You might try a more simplistic smartlist that grabs Track #5 from all albums, and expands those albums to full albums:

   [Media Type]=[Audio] [Track #]=5 ~a
Title: Re: Display: 2-digit track numbers and total album tracks possible?
Post by: rick.ca on August 02, 2012, 08:46:07 pm
Quote
You might try a more simplistic smartlist that grabs Track #5 from all albums, and expands those albums to full albums:

I'm sure that was intended only as a simple illustration of the problem. There are many things that can't be done if the result of the number of album tracks calculation can't be used in an expression or search. Do you have any idea why expression fields are treated as strings (in any Search dialog) and apparently can't be covered to integer or decimal? Or used in a Compare() or IsEqual()?
Title: Re: Display: 2-digit track numbers and total album tracks possible?
Post by: MrC on August 02, 2012, 09:43:48 pm
How about this format?

   [=Compare([Number Tracks], =, 5)]=1
Title: Re: Display: 2-digit track numbers and total album tracks possible?
Post by: rick.ca on August 02, 2012, 10:44:35 pm
Quote
[=Compare([Number Tracks], =, 5)]=1

Oops. I thought I had tried that, but I have a bad habit of typing '=[' instead of '[='. I need AutoCorrect for the Expression Editor. :-[

Thanks!