INTERACT FORUM

Please login or register.

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

Author Topic: Expressions  (Read 1407 times)

park

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 2358
  • I wish I had more to say!
Expressions
« on: November 17, 2005, 07:18:26 pm »

Hi,
Just wondering if there would be any way to accomplish the following, I guess using expressions:

a) Rename/move all [Album Rating]=2 to one hard drive and everything over 3 to another hard drive.

b)Sort all [Subject]=Place photos into one folder structure, and all [Subject]=People to another.

c)Make a smartlist or view scheme that sorts the albums, "most played album this month" descending.

Thanks,
Bri
Logged

marko

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 9124
Re: Expressions
« Reply #1 on: November 18, 2005, 03:05:09 am »

a) Rename/move all [Album Rating]=2 to one hard drive and everything over 3 to another hard drive.
I've looked at this in the past as I wanted a certain genre to go to another drive, but as the rename from properties dialogue needs a base path to work from, and the basepath field won't accept an expression, I don't see how to achieve it, though i do seem to remember Matt saying it was possible.

Quote
b)Sort all [Subject]=Place photos into one folder structure, and all [Subject]=People to another.
This is do-able. As you've not mentioned your paths, you'll need to enter them yourself:

if(isequal([subject],Place,1),put your 'places' path here,if(isequal([subject],People,1),put your 'people' path here,put path path for all other subjects here))

Quote
c)Make a smartlist or view scheme that sorts the albums, "most played album this month" descending.
You can't do this because the [number plays] field keeps a count of 'all time' and that is it. Also, the closest you can get to "this month" that I can see atm, is [last played]=<30d
mid(...) does not appear to work with the [last played] field.

-marko

park

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 2358
  • I wish I had more to say!
Re: Expressions
« Reply #2 on: November 21, 2005, 08:15:08 am »

Thanks Marko. I'm a bit confused about why no.2 is possible but not no.1 though. They both use the same tool (rename files from properties) to move the files, so if I can make it create a folder structure based on the subject tag, surely I'd be able to do the same for "album rating" too, wouldnt I?
Logged

marko

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 9124
Re: Expressions
« Reply #3 on: November 21, 2005, 01:58:56 pm »

yes, but if you look at the rename from properties dialogue, the first field is called "base path"

In No.1, you want a different base path, (drive letter) depending upon rating, and so far, I've been unable to get the rename from props tool to say "if this is true, use drive d:, otherwise, use drive e."

When the database expressions were first announced, I remember LisaRCT asking about the ability to place artists a-m on one drive, and n-z on another. I'm also 99% certain that Matt replied saying it was do-able and posting an example, but I cannot find the thread for love nor money!!

If anyone else has this worked out, what's the solution?

-marko.

jgreen

  • Citizen of the Universe
  • *****
  • Posts: 2419
Re: Expressions
« Reply #4 on: November 21, 2005, 02:12:51 pm »

Park--
Unless there's a trick to this I'm missing, you don't need expressions to accomplish task a).  This can be done in an audio library view that includes either panes for rating or a column for rating, right?  Renaming file from properties would then work perfectly.
Logged

marko

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 9124
Re: Expressions
« Reply #5 on: November 21, 2005, 03:46:48 pm »

jgreen, park,

my understanding was that what was being asked for was a single rule that allowed for selecting a whole bunch of files and saying:

if [album rating]=2 move it to drive 'a' and if it's equal to or greater than 3, move it to drive 'b'

for this, you'd need an if(isequal(...),,) expression. you cannot use expressions in the base path field, so as far as I can see, it's not possible right now.

Naturally, it would be simple enough to manually select all the [album rating]=2 albums and apply a rename from properties to those, then select all the 3 and overs, and apply different rename from props rules to those too.

Much simpler if we could just select a bunch of files and have the rename from props tools work from expressions, making all the appropriate choices for us.
I keep most of video files, 99% of my image files and all of my audio files on one drive. Regardless of what files I'm working on, I select them all, launch rename from properties and click the OK button. The expressions take care of placing the files in their correct directories depending on file type etc.
These two expressions took me forever and a day to work out, involving copious helpings of trial and error, but having got them working, I feel it was time well spent. What would be cool here would be a way to set a "default" for rename from props, then have a hotkey combo that applies those defaults, bypassing the need to load the dialogue and click the OK button :)

The base path is set as the drive root:

The directory expression:
IF(IsEqual([media type],audio,1),if(isequal([album],Assorted Tracks),My Music\[album],if(isempty([disc #],1),My Music\[file type]\[album artist (auto)]\[Album],My Music\[file type]\[album artist (auto)]\[Album]\Disc [disc #])),IF(IsEqual([media type],image,1),IF(IsEqual([genre],album art,1),My Music\[genre],My Pictures\MC\[date (year)]\[date (month)]),Movies\[genre])


and the filename expression:
IF(IsEqual([media type],audio,1),If(IsEqual([album artist (auto)], /(Multiple Artists/), 1),[track #] - [artist] - [name],[track #] - [name]),IF(IsEqual([media type],image,1),IF(IsEqual([genre],album art,1),[album artist (auto)] - [album] /([keywords]/) ~ [dimensions],[date (filename friendly)]),IF(IsEqual([genre],Music Video,1),[artist] - [name],[name]))


For those rare occasions where I'm dealing with files that will go to a different drive, I have to change things around. If we could use an expression in the base path field, then I for one, would be all set, just needing a single set of rename from properties rules to cover all my filenaming needs.

from the questions park was asking, I somehow figured he was aiming for a similar kind of solution. either way, it still offered the chance to talk about expressions in the base path field. hopefully, the ability will be put in place someday.

-marko.

park

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 2358
  • I wish I had more to say!
Re: Expressions
« Reply #6 on: November 21, 2005, 06:32:15 pm »

You're absolutely right Marko. I have recently bought a 100gb portable hard disk and I have my MC library files on it, and most of my audio and photos. However, that means that it's already full up. I am looking for an automatic one step process to send all of my 2 star stuff to a different drive, and in the process, neatly seperate my photos into two structures; one for people, and one for places.
You have definitely helped in the latter.
Thanks,
Bri
Logged
Pages: [1]   Go Up