INTERACT FORUM

Please login or register.

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

Author Topic: Reverse Import Tool?? Help  (Read 1480 times)

locust

  • Citizen of the Universe
  • *****
  • Posts: 699
Reverse Import Tool?? Help
« on: February 20, 2012, 07:15:29 am »

Can anybody help me please I am trying to create a reverse import tool that will check a files directory and filename structure against fields in the library. And if they do not equal it will flag them up so that I can move them to their proper location.

I also have a [!Drive] field that has acceptable values of D;Z;X;C. These are all the hard drive locations of my media and X is a mapped network drive off another computer. The purpose of this field is for moving files between drives. For instance I have file A and it is located on the C drive, if I change the value of [!Drive] to X, in the following expression it will filter though and the file will show up in my import tool and then coupled with the expressions I use to move my videos mc will move it on to the drive. (This part works)

Here is how far I've got, there are more pitfalls than I anticipated.

Here is my [!Drive.Calc] field
if(isempty([!Drive]),left([filename],1),if(isequal([!Drive],left([filename],1),8),[!Drive],[!Drive]))

The next field is [!Drive.Calc.Sorting]
if(isempty([Series]),[!Drive.calc]:\Users\Home\Videos\[Media Sub Type],[!Drive.calc]:\Users\Home\Videos\[Media Sub Type]\[Series]if(isequal([Season],unknown,8),,\0[Season]))\

(The reason there is a 0 preceding the Season field is that somehow even though the field doesn't contain any 0's, the file structure has them. I don't know why (I must also mention I have only begun to do this with video files, if anyone can help elaborate the expression for all file types that would be great.)

Next is
[!Drive.Calc.Sorting.Filename]
if(isempty([disc #]),,[Disc #] - )if(isempty([Episode]),,[Episode] - )[Name].[File Type]

Now I have a couple of badly named control fields
[!1T]
if(isequal([filename (path)],[!Drive.Calc.Sorting],8),,Path)
 (If the path structure is equal to my other calculated field nothing will happen, it it isn't the word Path will flag up. The same goes for below but only with the filename.)

[!2T]
if(isequal([filename (Name)],[!Drive.Calc.Sorting.Filename],8),,Name)

[!3C]
if(isequal([!1T],Path,1),if(isequal([!2T],Name,1),Import,),)

My import tool is just a search list which has the following rules  [{Flag: Video}]="Correctly Tagged" [!3C]="Import"
As far as I can tell it works although there are some files I know that should be included in the list that aren't.

Also I have thought of another pitfall I haven't found a way around yet. Special Characters, some of my fields have them and they are comparing the filename path and name for equality. I need to somehow get my expressions to completely ignore special characters (Maybe with Regex??). And also I know that sometimes when there is a special characters in the field they get converted to an underscore '_' I would need to find a way around that as well.

Here are the renaming expressions I use to move my files Note this is only for video
Directories - Base Path
[!Drive.calc]:\Users\Home\Videos\if(isempty([Media Sub Type]),\~Error,\[Media Sub Type])if(isequal([Series],unknown,8),,\[Series])if(isequal([Season],unknown,8),,\[Season])\

Filename
if(isequal([Disc #],unknown,8),,\[Disc #] - )if(isequal([Episode],unknown,8),,\[Episode] - )[Name]

I think it should be possible if not rather complicated,
I will appreciate any help
Thanks
Logged

MrC

  • Citizen of the Universe
  • *****
  • Posts: 10462
  • Your life is short. Give me your money.
Re: Reverse Import Tool?? Help
« Reply #1 on: February 20, 2012, 12:06:44 pm »

If you have your Rename rules, you can select all your files and startup the Rename tool.  Files that would be renamed will show that fact; files that don't are indicated.
Logged
The opinions I express represent my own folly.

locust

  • Citizen of the Universe
  • *****
  • Posts: 699
Re: Reverse Import Tool?? Help
« Reply #2 on: February 20, 2012, 12:31:36 pm »

 :o That thought never crossed my mind I got so wrapped up in making a neat little view that would show the appropriate files.

Thanks MrC, I'll spend some more time making better renaming expressions

Cheers
Logged
Pages: [1]   Go Up