INTERACT FORUM

Please login or register.

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

Author Topic: Help with an expression  (Read 841 times)

stumpygremlin

  • World Citizen
  • ***
  • Posts: 121
Help with an expression
« on: February 24, 2015, 07:08:16 pm »

I'm wondering if it's possible to create a field that will display the following:

If the path of the file is "E:\Music\Albums", then have it display, "[Band] - [Album]"
If the path of the file is "E:\Music\Songs", then have it display, "[Artist] - [Name]"
If the path of the file is "E:\Music\Various", then have it display, "[Album]"

I'm just merely curious, that's all.
Logged

ferday

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 1732
Re: Help with an expression
« Reply #1 on: February 24, 2015, 07:41:11 pm »

ifelse(isequal([filename (path)],"E:\Music\Albums"),[band]-[album],isequal([....])

i'm pretty sure something like that will work fine.  i have a couple smartlists that use isequal ([filename (path)]) but they don't make it output anything, they are just there to make only certain folders display

Logged

dtc

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 3119
Re: Help with an expression
« Reply #2 on: February 24, 2015, 09:36:48 pm »

isequal also has a contains option, which means you can drop the path, making the expressions shorter and easier to write.  And it still works if you if change the path in the future.

isequal([filename (path)],"Albums",8)
Logged
Pages: [1]   Go Up