INTERACT FORUM

Please login or register.

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

Author Topic: If/else/then operator in a Smartlist  (Read 1126 times)

Humbledore

  • Galactic Citizen
  • ****
  • Posts: 272
If/else/then operator in a Smartlist
« on: June 06, 2014, 05:14:48 pm »

Hi,
is it possible to use some kind of if/else/then operator in a Smartlist?

Like for example to achieve this:
If Artist 'X' < 10 files then load other Playlist/Smartlist

or this:
If my 1st rule = 0 files then use 2nd rule

Hope you got it!

Thanks!


   
Logged

MrC

  • Citizen of the Universe
  • *****
  • Posts: 10462
  • Your life is short. Give me your money.
Re: If/else/then operator in a Smartlist
« Reply #1 on: June 08, 2014, 03:03:53 pm »

You can use expression-based queries, however what you are asking to do is more than that.

In your first example, you're asking questions about an Artist, but the MC expression language works by asking questions about File Properties.  So you can ask Does this file have Artist = X?  You want to ask Does this Artist have N files?, but the expression language doesn't work that way.  To think in terms of MC's expression language, you have to pretend to be a file, and as a file you can ask yourself Does my property X have value Y?

In your second example, you are again asking a higher-level question: After running the expression, are there X numbers of files produced?  And that answer cannot be known by the expression language because on a file-by-file basis, each file can ask itself questions and provide answers, but once the run through each file is complete, the expression evaluation is complete.  There's no more opportunity to now have an expression segment that counts the previous results.

There are tricks you can perform using MC's Set rules for file display and Global Variables to do things like this, but for most users they are very complicated and difficult to manage.
Logged
The opinions I express represent my own folly.

Humbledore

  • Galactic Citizen
  • ****
  • Posts: 272
Re: If/else/then operator in a Smartlist
« Reply #2 on: June 08, 2014, 04:13:05 pm »

MrC, thank you very much for your answer!
It was more or less what I expected it to be... Then I know more what I have to play with!
Logged

nitephlight

  • World Citizen
  • ***
  • Posts: 142
Re:
« Reply #3 on: June 08, 2014, 05:10:42 pm »

Great post
Logged
Pages: [1]   Go Up