INTERACT FORUM

Please login or register.

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

Author Topic: i need one simple expression! please help  (Read 3007 times)

cron0sRXR8

  • Galactic Citizen
  • ****
  • Posts: 296
i need one simple expression! please help
« on: July 12, 2014, 12:41:20 pm »

I need make a smartlist with the films of 3 folders. This folders are these:

"D:\Mis Vídeos\Animation Films\"
"D:\Mis Vídeos\Animation Series\"
"D:\Mis Vídeos\Animation Short Films\"

I try it with this code:

[Media Sub Type]=[Movie],[Short],[TV Show] [Filename (path)]=[D:\Mis Vídeos\Animation Films\; D:\Mis Vídeos\Animation Series\; D:\Mis Vídeos\Animation Short Films\] ~sort=[Filename (name)]

And I try it with this code:
[Media Sub Type]=[Movie],[Short],[TV Show] [Filename (path)]=[D:\Mis Vídeos\Animation Films\] [Filename (path)]=[D:\Mis Vídeos\Animation Series\] [Filename (path)]=[D:\Mis Vídeos\Animation Short Films\] ~sort=[Filename (name)]


But nothing it doesn't works.

Anyone can help me please? what is OR expression? what is AND expression? I want: "folder 1 OR folder 2 OR folder 3"

If I use only one folder I can do it but with 3 folders i don't know how to do it!

Thank you!
Logged

glynor

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 19608
Re: i need one simple expression! please help
« Reply #1 on: July 12, 2014, 02:13:53 pm »

Well, a simpler way to do it would be:

Code: [Select]
[Media Sub Type]=[Movie],[Short],[TV Show] [Filename]="D:\Mis Vídeos\Animation" ~sort=[Filename (name)]
You can do AND/OR if you want (and XOR if you're a bit clever), but in this case you don't need to.  Just use the "contains" version of == instead of the exact text match.

Generally, you'd be best off applying proper tags to those files, and use those.  So, for those examples, you could use a combination of Media Sub Type and Genre for each.

Apply [Genre] = Animation for the entire "D:\Mis Videos\Amination*" directory structure (or something similar).
Apply [Media Sub Types] to the files properly (TV Show for the series, Movie for the Films, and Shorts for the Shorts).

Then, filter your view to show only [Genre] = [Animation] and you can, if you choose, subfilter on the Media Sub Types with a column or category.
Logged
"Some cultures are defined by their relationship to cheese."

Visit me on the Interweb Thingie: http://glynor.com/

cron0sRXR8

  • Galactic Citizen
  • ****
  • Posts: 296
Re: i need one simple expression! please help
« Reply #2 on: July 12, 2014, 02:21:02 pm »

Well, a simpler way to do it would be:

Code: [Select]
[Media Sub Type]=[Movie],[Short],[TV Show] [Filename]="D:\Mis Vídeos\Animation" ~sort=[Filename (name)]
You can do AND/OR if you want (and XOR if you're a bit clever), but in this case you don't need to.  Just use the "contains" version of == instead of the exact text match.


If I use "contains" with the 3 folders also don't work  :-[:

[Filename (path)]="D:\Mis Vídeos\Animation Films\" [Filename (name)]="D:\Mis Vídeos\Animation Series\" [Filename (name)]="D:\Mis Vídeos\Animation Short Films\" ~sort=[Filename (name)]


Logged

glynor

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 19608
Re: i need one simple expression! please help
« Reply #3 on: July 12, 2014, 02:25:30 pm »


If I use "contains" with the 3 folders also don't work  :-[:

[Filename (path)]="D:\Mis Vídeos\Animation Films\" [Filename (name)]="D:\Mis Vídeos\Animation Series\" [Filename (name)]="D:\Mis Vídeos\Animation Short Films\" ~sort=[Filename (name)]

You didn't do what I gave you.

Contains means contains.  It is a text search.

[Filename]="D:\Mis Videos\Animation" matches all three.  You don't need to do it multiple times, unless you also need to exclude other "D:\Mis Videos\Animation SOME OTHER CRAP" folders (and, if there is only one, it'd be easiest to use an second search set to exclude those files).

You could even do [Filename]="\Mis Videos\Animation" if you needed to match folders on multiple volumes.
Logged
"Some cultures are defined by their relationship to cheese."

Visit me on the Interweb Thingie: http://glynor.com/

cron0sRXR8

  • Galactic Citizen
  • ****
  • Posts: 296
Re: i need one simple expression! please help
« Reply #4 on: July 12, 2014, 02:33:42 pm »

Sorry for my poor english, I take a screenshot:

https://drive.google.com/file/d/0B8y-hqUqRJttSTU3WkpCelhCUVU/edit?usp=sharing

this is that I've do it.

Do you say do it this?:

[Filename (path)]="D:\Mis Vídeos\Animation" ~sort=[Filename (name)]

this, in this case works fine. It's ok, thank you. But in another case I need make the same but the names of the folders are very different:

D:\Mis Vídeos\Test 1\
D:\Mis Vídeos\Jimy 2\
D:\Mis Vídeos\Pepe 14\

In this case, what is the good expression? I need a generic expression for ALL cases. Not for only one particular case.

Thank you friend!!
Logged

glynor

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 19608
Re: i need one simple expression! please help
« Reply #5 on: July 12, 2014, 02:36:44 pm »

Don't filter views and smartlists based on [Filename], except for in very specific (and rare) circumstances.  That's counter to the entire point of MC, and you're going to always have to fix the expressions later if you decide to re-organize files on disk.

Use tags.  If you have good, existing, data in your filesystem folder structure, MC can extract it and put it in whatever tags you want with the Fill Properties from Filename tool.

In other words: If that's what you need, you're doing it wrong.

Essentially the only places my views and lists have [Filename] filters is to exclude certain folders (like my user profile's default "Documents" and "Pictures" folders) where I am too lazy to clean up the mess and I just want everything hidden from those folders.

EDIT: Not to say you can't, it is just a bad idea.  I linked to the instructions on the Wiki for AND/OR above (it "ands" by default, and you have to specify OR, is the deal) if you insist.
Logged
"Some cultures are defined by their relationship to cheese."

Visit me on the Interweb Thingie: http://glynor.com/

cron0sRXR8

  • Galactic Citizen
  • ****
  • Posts: 296
Re: i need one simple expression! please help
« Reply #6 on: July 12, 2014, 02:46:45 pm »

I understand you. Always I use tags for smartlist and views. But this is a very specific case. So I understand that I need use OR expression.

I've read the wiki and I've tried to do but it doesn't works:

[Filename (path)]="D:\Mis Vídeos\Animation Films\" or [Filename (name)]="D:\Mis Vídeos\Animation Series\" or [Filename (name)]="D:\Mis Vídeos\Animation Short Films\" ~sort=[Filename (name)]

this is not correct?

Thank you another time!!!
Logged

glynor

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 19608
Re: i need one simple expression! please help
« Reply #7 on: July 12, 2014, 05:56:34 pm »

Put the ORed items in parens.
Logged
"Some cultures are defined by their relationship to cheese."

Visit me on the Interweb Thingie: http://glynor.com/

cron0sRXR8

  • Galactic Citizen
  • ****
  • Posts: 296
Re: i need one simple expression! please help
« Reply #8 on: July 13, 2014, 05:30:45 am »

Put the ORed items in parens.

ops, sorry, I don't understand. What is ORed items? you want say this?

Quote
[[Filename (path)]="D:\Mis Vídeos\Animation Films\"] or [[Filename (name)]="D:\Mis Vídeos\Animation Series\"] or [[Filename (name)]="D:\Mis Vídeos\Animation Short Films\"] ~sort=[Filename (name)]

this don't works  :-[
Logged

glynor

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 19608
Re: i need one simple expression! please help
« Reply #9 on: July 13, 2014, 03:21:30 pm »

From the Wiki article linked above:
Quote
(s1 op s2): Groups search terms to force precedence when using multiple search terms with the and and the or operators.

Example: Return all files whose artist is exactly Bob Dylan and whose year is either 1966 or 2001:

[Artist]=[Bob Dylan] ([Date (year)]=1966 or [Date (year)]=2001)

Note the distinction of the example above with the following example:

[Artist]=[Bob Dylan] [Date (year)]=1966 or [Date (year)]=2001

The first example uses grouping parenthesis to force the order of evaluation, and returns files from Bob Dylan as the artist, from the year 1966 or 2001. The second example, due to order of evaluation from left to right, returns files with Bob Dylan as the artist from the year 1966, and also returns all files with year 2001.

val1,val2: Combines two or more values into a list, identical to the or operator. No spaces are allowed between the comma(s) and the values.

Example: Return all files whose artist is any of Queen, Heart, or the Grateful Dead:

artist=[Queen],[Heart],"Grateful Dead"

The search phrase in the example above is identical to the more cumbersome:

([Artist]=[Queen] or [Artist]=[Heart] or [Artist]="Grateful Dead")

So, what I meant was:

Code: [Select]
([Filename (path)]="D:\Mis Vídeos\Animation Films\" or [Filename (name)]="D:\Mis Vídeos\Animation Series\" or [Filename (name)]="D:\Mis Vídeos\Animation Short Films\") ~sort=[Filename (name)]
See how there are parenthesis (the curved ones, not square brackets) around the whole set of items where you say "OR" between them?  That way, it is treated as all one search term.

Code: [Select]
([Field]="x" OR [Field]="y" OR [Field]="z")
AND
~sort=[Sort Fields]

Without the parenthesis, it doesn't work.  However, you can simplify it with the second of the two methods quoted above to:

Code: [Select]
([Field]="x","y","z")
Note, however, that the comma-separated list CANNOT have spaces between the items (so the commas should be right up against the quotation marks, like in my example above).

So, your expression above can be simplified as:

Code: [Select]
([Filename]="D:\Mis Vídeos\Animation Films\","D:\Mis Vídeos\Animation Series\","D:\Mis Vídeos\Animation Short Films\") ~sort=[Filename (name)]
Note, that when doing the filter, I'd do it against [Filename] and not [Filename (path)].  The [Filename] field is the real field, and contains the full path and the filename, and the others are calculated using it.  There's no reason to use the others, and using a calculated field in an expression can sometimes have unexpected results if you don't understand the expression language well.

I don't think it matters in this case, but there's no reason to use it, so a good rule of thumb is to avoid them if not needed, and use "real" fields.
Logged
"Some cultures are defined by their relationship to cheese."

Visit me on the Interweb Thingie: http://glynor.com/

cron0sRXR8

  • Galactic Citizen
  • ****
  • Posts: 296
Re: i need one simple expression! please help
« Reply #10 on: August 30, 2014, 10:21:34 am »

sorry for the delay in my reply...

Quote
([Filename]="D:\Mis Vídeos\Animation Films\","D:\Mis Vídeos\Animation Series\","D:\Mis Vídeos\Animation Short Films\") ~sort=[Filename (name)]

thank you, this expression works very fine.

Thank you glynor!
Logged
Pages: [1]   Go Up