INTERACT FORUM

Please login or register.

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

Author Topic: Smart List Question: Filenames that don't match tags?  (Read 3820 times)

TimMedcalf

  • Regular Member
  • Recent member
  • *
  • Posts: 31
  • Change this by choosing profile
Smart List Question: Filenames that don't match tags?
« on: March 19, 2006, 01:33:15 am »

Hi Everyone,

I was wondering if its possible to find all files whose filenames don't match my naming scheme (Artist - Album - Track# - Name)?

I know i can automatically change files to match the scheme, but i'd like to know which files i'm affecting first.

Any ideas? I'm useless with the Smartlist stuff so any help would be greatly appreciated!
Logged

hit_ny

  • Citizen of the Universe
  • *****
  • Posts: 3310
  • nothing more to say...
Re: Smart List Question: Filenames that don't match tags?
« Reply #1 on: March 19, 2006, 09:20:50 am »

How about this:

- Create a custom tag [Tag 1] that has as calculated data [Artist] - [Album] - [Track#] - [Name]
- Create another custom tag [Tag 2] that is of String type. Copy from Filename (name) into it. Then Do a Search & Replace on it, to remove the .mp3/ape/.etc (extn).

- Now create a viewscheme that includes the above 2 tags. And a 3rd field that is an expression. For that Expression enter

IsEqual([Tag 1], [Tag 2], 1)

Compares values and outputs a "1" if the values pass the test, and "0" if they don't pass the test.

Click the header bar for the expression column in the viewscheme, all the '0's should be the files that you want.
Logged

TimMedcalf

  • Regular Member
  • Recent member
  • *
  • Posts: 31
  • Change this by choosing profile
Re: Smart List Question: Filenames that don't match tags?
« Reply #2 on: March 19, 2006, 04:56:21 pm »

Cheers for that!

Its not quite working yet....there are a couple of issues that its a bit late in the day for me to solve right now but its nearly there!

I'll see if i can sort it tomorrow, but the main problems so far..

1) The Tracknumber going into Tag1 doesn't have a leading zero (if less than 10), but the filenames do.
2) The IsEqual bit doesn't seem to work, but i may have messed it up....

Its close tho....a bit of messing and i'm sure it can be done.

I've been using MC for nearly two years now, and i never knew it was this powerful!!!  :-[
Logged

hit_ny

  • Citizen of the Universe
  • *****
  • Posts: 3310
  • nothing more to say...
Re: Smart List Question: Filenames that don't match tags?
« Reply #3 on: March 19, 2006, 08:00:46 pm »

1) The Tracknumber going into Tag1 doesn't have a leading zero (if less than 10), but the filenames do.
It's possible to use expressions in the calculated field (11.1 tho)..

if less than 10 then output 0[Track #] else [Track #]

If(IsEqual([Track #], 10, 3), 0[Track #], [Track #])

so the calculated field for [Tag 1] would look like

[Artist] - [Album] - If(IsEqual([Track #], 10, 3), 0[Track #], [Track #]) - [Name]
Logged

marko

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 9139
Re: Smart List Question: Filenames that don't match tags?
« Reply #4 on: March 20, 2006, 01:27:55 am »

It's possible to use expressions in the calculated field (11.1 tho)..

if less than 10 then output 0[Track#] else [Track#]

If(IsEqual([Track#], 10, 3), 0[Track#], [Track#])

so the calculated filed for [Tag 1] would look like

[Artist] - [Album] - (If(IsEqual([Track#], 10, 3), 0[Track#], [Track#])) - [Name]
Nice work hit_ny. Just a slight correction needed though, I think?

In your example, the track number would be enclosed in brackets (04), and we also need a space before the hash in the track number field name. I tested the string below and it works perfectly here. Simply copy/paste.

[artist] - [album] - if(isequal([Track #],10,3),0[Track #],[Track #]) - [name]

hit_ny

  • Citizen of the Universe
  • *****
  • Posts: 3310
  • nothing more to say...
Re: Smart List Question: Filenames that don't match tags?
« Reply #5 on: March 20, 2006, 01:54:28 am »

Yep, just noticed that..

Thing is tho, you have to create the custom tags just to be able to compare them with IsEqual()

i tried just adding a third expression column, and doing a simple compare in a third column IsEqual([Tag 1], [Tag 2], 1)

but it would not take.

It's not possible to dynamically reference temporary expression columns in a viewscheme yet.
Logged

marko

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 9139
Re: Smart List Question: Filenames that don't match tags?
« Reply #6 on: March 20, 2006, 02:13:47 am »

Would it not work if you added .[file type] to [tag 1]?

[artist] - [album] - if(isequal([Track #],10,3),0[Track #],[Track #]) - [name].[file type]

then use the expression:

isequal([tag 1],[filename (name)],1)

....

I just tried this and it does work as expected. pretty neat huh :)

If you want a little more elegance than just a one or a zero, you could use:

if(isequal([tag 1],[filename (name)],1),matching,unmatched)

hit_ny

  • Citizen of the Universe
  • *****
  • Posts: 3310
  • nothing more to say...
Re: Smart List Question: Filenames that don't match tags?
« Reply #7 on: March 20, 2006, 03:06:27 am »

isequal([tag 1],[filename (name)],1)

....

I just tried this and it does work as expected. pretty neat huh :)
You are saying it is possible to reference an expression as [tag 1] w/o creating it first ?

Is so, should make things a lot neater.
Logged

marko

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 9139
Re: Smart List Question: Filenames that don't match tags?
« Reply #8 on: March 20, 2006, 04:01:56 am »

no. I created [tag 1] 1st via the library options. apologies for the confusion :)

In my experience, expression based panes cannot be used for anything other than populating the pane itself.

I just figured that adding the .[filetype] to [tag 1] removed the need for a [tag 2] and the search/replace steps, thus simplifying things a little further.

marko

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 9139
Re: Smart List Question: Filenames that don't match tags?
« Reply #9 on: March 20, 2006, 04:49:57 am »

hmmm, another fly in the ointment here is illegal filename characters...

The filename for Van Morrison's "what's wrong with this picture?" is actually "what's wrong with this picture_" so it gets flagged as unmatched.

I can't quickly think of a way round that other than exclude those files ( -[filename (name)]=_ ) then check them manually afterwards?

hit_ny

  • Citizen of the Universe
  • *****
  • Posts: 3310
  • nothing more to say...
Re: Smart List Question: Filenames that don't match tags?
« Reply #10 on: March 20, 2006, 06:01:24 am »

Yeah, or a filter for characters like

 \ / : * ? " < > |

in the tags
Logged

pahunt

  • World Citizen
  • ***
  • Posts: 236
Re: Smart List Question: Filenames that don't match tags?
« Reply #11 on: March 20, 2006, 02:43:45 pm »

This is the expression I use as a calculated field

D:\Paul\My Documents\My Music\If(IsEmpty([Album Artist (auto)]),Unknown Artist,If(IsEqual([Album Artist (auto)],/(Multiple Artists/),1),Assorted,[Artist]))\If(IsEmpty([Album]),Unknown Album,If(IsEmpty([Disc #], 1),[Album],[Album]\Disc [Disc #]))\If(IsRange([Track #], 1-9), 0[Track #], If(IsEqual([Track #],0,2),00,[Track #])) - [Name].[File Type]

This is for a folder structure of [Artist]\[Album]\[Disc #]\ with a filename of [Track #] - [Name]. As Marko says illegal characters are a problem and I haven't found a way around it, some kind of Replace function would be nice!

TimMedcalf

  • Regular Member
  • Recent member
  • *
  • Posts: 31
  • Change this by choosing profile
Re: Smart List Question: Filenames that don't match tags?
« Reply #12 on: March 20, 2006, 05:10:34 pm »

I really appreciate all the help i've recieved on this.

I agree, the illegal filename chars really mess things up...perhaps automatically checking for filename rule violations could be an automatic feature of MC? Would be cool if it could be just one of the "Task" smartlists!
Logged

marko

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 9139
One for the "Audio Workshop"
« Reply #13 on: April 21, 2006, 04:57:13 am »

Would it not work if you added .[file type] to [tag 1]?

[artist] - [album] - if(isequal([Track #],10,3),0[Track #],[Track #]) - [name].[file type]

then use the expression:

isequal([tag 1],[filename (name)],1)

....

I just tried this and it does work as expected. pretty neat huh :)

If you want a little more elegance than just a one or a zero, you could use:

if(isequal([tag 1],[filename (name)],1),matching,unmatched)


with the recent addition of If(...) modes 7 and 8, we can now make an expression based pane to show files with illegal characters, files that match the naming template, and those that don't.

I chose "illegal", "mis-matched" and "sync'd".
I called Tag1 "namecheck"

Create a new viewscheme (if you like, call it check file names) Use any panes you like, but one of them, the first one makes most sense to me, needs to be an advanced expression. I called mine filename check?.

the expression goes like so:

if(isequal([name],//,7),illegal,if(isequal([name],\,7),illegal,if(isequal([name],?,7),illegal,if(isequal([name],*,7),illegal,if(isequal([name],:,7),illegal,if(isequal([name],/",7),illegal,if(isequal([namecheck],[filename (name)],1),sync'd, mis-matched)))))))

----------------
a mildly interesting, not often needed viewscheme for the workshop only, i think :)
Pages: [1]   Go Up