INTERACT FORUM

Please login or register.

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

Author Topic: Condition relative to album, not to track, how ?  (Read 3211 times)

Cmely

  • Junior Woodchuck
  • **
  • Posts: 82
Condition relative to album, not to track, how ?
« on: December 24, 2016, 10:17:53 am »

Hello,

I've been looking for a solution but found nothing to help me, so I ask the forum.

I would like to make some filters / conditions that test some field values and apply the result to the whole album  :o
With some example it will be easier to understand, I guess (I have to admit that I have myself some difficulties to understand my previous sentence  :D :D).

For instance, I would like to be able to set a view / filter with this kind of condition :

- If at least one track of the album have been played don't show the whole album (in order to create a real 'never played' view)
OR
- If at least one track of the album is rated 5 stars then show the whole album.

For the first test I was thinking to calculate the sum of the "Played Number' field, but couldn't find how.
If you have any clue, I'll be very grateful  :D

ferday

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 1732
Re: Condition relative to album, not to track, how ?
« Reply #1 on: December 25, 2016, 01:01:49 am »

The "album" isn't a thing in MC.  But...I think it could be at least somewhat done with variables.  Variables aren't super simple, I'll think about it though
Logged

mark_h

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 1855
Re: Condition relative to album, not to track, how ?
« Reply #2 on: December 25, 2016, 02:54:37 am »

Yeah, variables are the answer.

https://wiki.jriver.com/index.php/Global_Variables

Although the second is as simple as:

[Rating]=5 ~a
Logged

mark_h

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 1855
Re: Condition relative to album, not to track, how ?
« Reply #3 on: December 25, 2016, 03:08:51 am »

My smartlist for how many times an album has been played: (create your own smartlist with these rules: it will be used below)

[Media Type]=[Audio] [=save(100000,v_albumplayed[album artist (auto)][album])1]=1 [=if(compare([number plays],<,load(v_albumplayed[album artist (auto)][album])),save([number plays],v_albumplayed[album artist (auto)][album]),1)1]=1

Once run, the number of plays for a given album will be stored in the variable: v_albumplayed[album artist (auto)][album] and you can create the filter, eg

[=compare(load(v_albumplayed[album artist (auto)][album]),=,0)]=1

This will result in only showing albums that have never been played.

Then you can OR the two rules above in the finale smartlist:

playlistid==* ([=compare(load(v_albumplayed[album artist (auto)][album]),=,0)]=1 or [Rating]=5) ~a

*your smartlist containing the rules above that calculate the number of plays.

[edit: fixed some errors transcribing from my setup to this example!]
Logged

mark_h

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 1855
Re: Condition relative to album, not to track, how ?
« Reply #4 on: December 25, 2016, 03:22:44 am »

Although, now I've reread your original request, I see you might be asking for something slightly different, eg

If an album has a track rated 5, show the whole album
Otherwise
Show all unplayed album tracks

All you need for that is two smartlists; one for each condition.  And then a smartlist that calls both to combine the results.

eg,

smartlist 1: [Rating]=5 ~a
smartlist 2: [Number Plays]=0

smartlist 3: playlists IS ANY smartlist1, smartlist 2

Logged

Cmely

  • Junior Woodchuck
  • **
  • Posts: 82
Re: Condition relative to album, not to track, how ?
« Reply #5 on: December 25, 2016, 11:40:40 am »

Ferday, Mark_h, thank you for helping.

Mark_h thank you for giving me more than a hint  :)

Your first answer was the best (for me). The two conditions didn't need to be tied together. However, both of your answers were very helping. Thanks !  :D

Cmely

  • Junior Woodchuck
  • **
  • Posts: 82
Re: Condition relative to album, not to track, how ?
« Reply #6 on: December 27, 2016, 09:40:50 am »

Mark_h, I've been trying to adapt your answer in order to create a View showing albums based on the number of times albums has been played...but I did certainly miss something and haven't been able to achieve this.

Would you be kind enough to point me in the right direction ? (I mean, I know this is already what you've done  :D but I'm afraid I'm not savvy enough ...).

mark_h

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 1855
Re: Condition relative to album, not to track, how ?
« Reply #7 on: December 28, 2016, 02:46:21 am »

I made some transcription errors copying the rules from my library to the example.  I've fixed those now...  Perhaps it now works better for you?
Logged

Cmely

  • Junior Woodchuck
  • **
  • Posts: 82
Re: Condition relative to album, not to track, how ?
« Reply #8 on: December 28, 2016, 07:35:05 am »

 ?

When I create a smartlist with your expression :

[Media Type]=[Audio] [=save(100000,v_albumplayed[album artist (auto)][album])1]=1 [=if(compare([number plays],<,load(v_albumplayed[album artist (auto)][album])),save([number plays],v_albumplayed[album artist (auto)][album]),1)1]=1

I get an empty smartlist. Is this normal ? (I've created it by using 'Import/export' in smartlist rules)

mark_h

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 1855
Re: Condition relative to album, not to track, how ?
« Reply #9 on: December 28, 2016, 07:41:56 am »

I copy and pasted that and get my entire collection presented.  This is what I'd expect, as the smartlist is looking at every entry to generate the 'album played' variable.

If I add an expression column to the result view with

load(v_albumplayed[album artist (auto)][album])

I see the album played count displayed...
Logged
Pages: [1]   Go Up