INTERACT FORUM

Please login or register.

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

Author Topic: Smartlist Problem  (Read 2602 times)

benn600

  • Citizen of the Universe
  • *****
  • Posts: 3849
  • Living: Santa Monica CA Hometown: Cedar Rapids IA
Smartlist Problem
« on: November 21, 2008, 11:53:37 am »

If I import text that includes "OR" the smartlist parser (nice gui) does not include these or statements.

Try copying this in as an import:
([Ben's Rating]=1 and -[Rating]=1) OR ([Ben's Rating]=2 and -[Rating]=2) OR ([Ben's Rating]=3 and -[Rating]=3) OR ([Ben's Rating]=4 and -[Rating]=4) OR ([Ben's Rating]=5 and -[Rating]=5) OR (-[Ben's Rating]=1 and [Rating]=1) OR (-[Ben's Rating]=2 and [Rating]=2) OR (-[Ben's Rating]=3 and [Rating]=3) OR (-[Ben's Rating]=4 and [Rating]=4) OR (-[Ben's Rating]=5 and [Rating]=5)

It works properly in the search box but in the smartlist import, the OR statements gets ignored and it then becomes AND for everything, and no results are returned or can be returned.
Logged

benn600

  • Citizen of the Universe
  • *****
  • Posts: 3849
  • Living: Santa Monica CA Hometown: Cedar Rapids IA
Re: Smartlist Problem
« Reply #1 on: November 23, 2008, 09:38:58 pm »

Please confirm or deny this problem.  Am I missing something?
Logged

marko

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 9119
Re: Smartlist Problem
« Reply #2 on: November 24, 2008, 01:46:58 am »

Ben, I've had a look, and am unable to confirm or deny, it's just too complex. I'm pretty sure it's a parenthesis placement problem.
For example, taking the first set of rules, the correct construction for the smartlist import/export wizard is:
(([Ben's Rating]=1 and -[Rating]=1) or ([Ben's Rating]=2 and -[Rating]=2))


Looking at your string, it looks to me as if you want to list all files where [Rating] is not equal to [Ben's Rating], so, if I got that right, try the following:
[media type]=[audio] -r=[] [=isequal([Ben's Rating],[rating])]=0

Better now?

StFeder

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 1493
  • Fight! You may win. If you don't, you already lost
Re: Smartlist Problem
« Reply #3 on: November 24, 2008, 02:13:32 am »

I've had some similar problem some time ago related with "AND" and "OR" in smartlist. Gappie teached me that "AND" and "OR" is replaced by brackets. To connect rules with "AND" you have to use square-brackets "[...]" und round-brackets "(...)" to get an "OR" connection.

So for my understanding your smartlist should look like this to work again (I couldn't test):

Code: [Select]
([[Ben's Rating]=1 -[Rating]=1] [[Ben's Rating]=2 -[Rating]=2] [[Ben's Rating]=3 -[Rating]=3] [[Ben's Rating]=4 -[Rating]=4] [[Ben's Rating]=5 -[Rating]=5] [-[Ben's Rating]=1 [Rating]=1] [-[Ben's Rating]=2 [Rating]=2] [-[Ben's Rating]=3 [Rating]=3] [-[Ben's Rating]=4 [Rating]=4] [-[Ben's Rating]=5 [Rating]=5])
Of course, markos suggestion is smarter!
Logged

benn600

  • Citizen of the Universe
  • *****
  • Posts: 3849
  • Living: Santa Monica CA Hometown: Cedar Rapids IA
Re: Smartlist Problem
« Reply #4 on: November 24, 2008, 12:47:01 pm »

Oh how I wish I could use SQL in the search box.  I am quite used to it and the rest of the world is.
Logged

benn600

  • Citizen of the Universe
  • *****
  • Posts: 3849
  • Living: Santa Monica CA Hometown: Cedar Rapids IA
Re: Smartlist Problem
« Reply #5 on: November 24, 2008, 01:13:47 pm »

Looking at your string, it looks to me as if you want to list all files where [Rating] is not equal to [Ben's Rating], so, if I got that right, try the following:
[media type]=[audio] -r=[] [=isequal([Ben's Rating],[rating])]=0

This appears to work perfectly!  Thanks a lot.  I will keep watching to see if it has any issues compared to my original string.  Overall, I wanted a simple [Rating] != [Ben's Rating] but MC is not quite the same as standard database language I am used to.  Good work and thank you!

I use Ben's Rating to store my own rating in each file so other users can still save their rating in the file.  Then, I have to be 100% sure to NOT store Rating in the files or I would notice issues across the board.  Thankfully, the personal rating means that each file on its own contains each user's rating so I am not relying on the MC database to keep my precious data safe.
Logged

marko

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 9119
Re: Smartlist Problem
« Reply #6 on: November 24, 2008, 01:34:00 pm »

Oh how I wish I could use SQL in the search box.  I am quite used to it and the rest of the world is.
I'm not!
I don't really know the first thing about SQL.
If I ever need to get into it, I'll probably be like "why can't they just do it the JRiver way" ;)

-marko.

benn600

  • Citizen of the Universe
  • *****
  • Posts: 3849
  • Living: Santa Monica CA Hometown: Cedar Rapids IA
Re: Smartlist Problem
« Reply #7 on: November 24, 2008, 02:22:54 pm »

Yep, precisely.  My only argument is that SQL is used by a host of major database applications including, but not limited to, MySQL, Oracle, Microsoft SQL, and even Access.

I could even create a SQL statement that would determine the ROWS to be returned.  So, in one easy to understand statement, an entire MC view could practically be created.

SELECT Name,Artist,Album FROM audio WHERE BensRating != Rating AND Genre == "Christmas" ORDER BY Album,TrackNum;
Logged
Pages: [1]   Go Up