It will reorg by genre then artist, year and album , then the file ( wich I have just as track - Song title. I adapted %E to be where I got it from - ie CD, itunes, friend, other, library
If you place "_Artist name" in the URL tag it will also move that set of mp3s to be with that artist - like a tribute album to that band under "User Appended"
It will also reorder soundtracks differently - by putting in the album first and then the year. Place "Soundtrack" in the type field or name the genre "soundtrack"
and singles it changes the format too for order. Place "Singles" in the "type" field
Last it will create any various artist albums under a VA folder. Place "VA" in the "type" field
Anyway it can be adapted pretty easily to other setup orders. Shows how to bring different sets of genres to one folder to.
Enjoy:
Code: Select all
{!%G%|%A%|%Y% - %L% - %E%|%XY%|%Y%|%L%|%W%|%E%}
// {!%A:1|%A|%Y - %L|%G}
// the first line contains the folder structure and is dynamically used upon script execution, it is optional
{
sample script to force special folder rules
the folder structure defined is the following :
%A , 1 - artist first letter
%A - artist
%Y - %L - year album
%G - dummy genre level, The %G variable is only used as an example of how to check for other values
%XY - type
%W - URL
}
program Advanced_folder_rules;
const
_MiscFolder = 'VA'; // mine is '0-9 & Misc'
var
sTmp: string;
sTmp2: string;
sTmp3: string;
begin
// phase 1 loop through entries and adjust values as needed
re_Init( false );
repeat
sTmp3 := re_getLevel(8 );
if sTmp3 + '-' = '-' then begin // see if genre is missing
re_setLevel(3,re_getLevel( 5 ) + ' - ' + re_getLevel( 6 ));
stmp3 := ''
end else begin
stmp3 := ' - ' + stmp3
end;
sTmp := re_getLevel(1 );
if sTmp + '-' = '-' then begin // see if genre is missing
re_setLevel( 1, 'MISSING' );
end;
// check for Various Artists in 'Type' field use VA Don't use on Soundtrack genre files - assumed to be VA
sTmp := re_getLevel(4);
sTmp2 := '0';
if UpperCase( sTmp ) = 'VA' then begin // VA type
re_setLevel(3,re_getLevel( 6 ) + ' - ' + re_getLevel( 5 ) + stmp3)
re_setLevel( 2, '+Various Artists' );
end;
if UpperCase( sTmp ) = 'VARIOUS ARTISTS' then begin // VA type
re_setLevel(3,re_getLevel( 6 ) + ' - ' + re_getLevel( 5 ) + stmp3)
re_setLevel( 2, '+Various Artists' );
end;
sTmp := re_getLevel(4);
if UpperCase( sTmp ) = 'SINGLES' then begin // singles
re_setLevel( 2,re_getLevel (1) );
re_setLevel(1, 'Singles')
re_removeLevel( 3 );
re_removeLevel( 3 );
re_removeLevel( 3 ); re_removeLevel( 3 );
end;
sTmp := re_getLevel(1);
if UpperCase( sTmp ) <> 'SOUNDTRACK' then begin // keep soundtrack related out of loop
sTmp := re_getLevel(7);
if sTmp <> '' then begin //get special directory and create first ' say you want CD Y by artist J in with artist K - put the artist name with a underscore in front of it
// in the tagging type field to get it moved
if UpperCase( Copy( sTmp, 1, 1 ) ) = '_' then begin // remove 'the'
re_setLevel(4,re_getLevel(2));
re_setLevel( 2, Copy( sTmp, 2, 9999 ) );
If sTmp = '_Singles' then begin
re_setLevel( 2,re_getLevel (1) );
re_setLevel(1, 'Singles') // dont use URL for singles use TYPE
re_removeLevel( 3 );
re_removeLevel( 3 );
re_removeLevel( 3 ); re_removeLevel( 3 );
end else begin;
re_addLevel( re_getLevel (3));
re_setLevel( 3,'+User Appended' );
sTmp2 := '1';
end;
end;
end;
end;
sTmp := re_getLevel(1)
if UpperCase( sTmp ) = 'EASY LISTENING' then begin // special genre
re_setLevel( 1, 'Light' );
end;
if UpperCase( sTmp ) = 'INDUSTRIAL' then begin // special genre
re_setLevel( 1, 'Industrial and Punk' );
end;
if UpperCase( sTmp ) = 'METAL' then begin // special genre
re_setLevel( 1, 'Industrial and Punk' );
end;
if UpperCase( sTmp ) = 'PUNK' then begin // special genre
re_setLevel( 1, 'Industrial and Punk' );
end;
if UpperCase( sTmp ) = '70S' then begin // special genre
re_setLevel( 1, '60s and 70s' );
end;
if UpperCase( sTmp ) = '60S' then begin // special genre
re_setLevel( 1, '60s and 70s' );
end;
if UpperCase( sTmp ) = 'TECHNO' then begin // special genre
re_setLevel( 1, 'Dance' );
end;
if UpperCase( sTmp ) = 'ALTERNATIVE' then begin // special genre
re_setLevel( 1, 'Alternative & Rock' );
end;
if UpperCase( sTmp ) = 'ROCK' then begin // special genre
re_setLevel( 1, 'Alternative & Rock' );
end;
if UpperCase( sTmp ) = 'ACID JAZZ' then begin // special genre
re_setLevel( 1, 'Swing Blues Jazz' );
end;
if UpperCase( sTmp ) = 'SWING' then begin // special genre
re_setLevel( 1, 'Swing Blues Jazz' );
end;
if UpperCase( sTmp ) = 'BLUES' then begin // special genre
re_setLevel( 1, 'Swing Blues Jazz' );
end;
if UpperCase( sTmp ) = 'JAZZ' then begin // special genre
re_setLevel( 1, 'Swing Blues Jazz' );
end;
// 1 2 3 4 5 6 7
//{!%G|%A|%Y - %L|%XY |%Y |%L |%W}
if UpperCase( sTmp ) = 'SOUNDTRACK' then begin // special genre
sTmp := re_getLevel(7 );
if UpperCase( Copy( sTmp, 1, 1 ) ) = '_' then begin // remove 'the'
re_setLevel( 2, Copy( sTmp, 2, 9999 ) );
re_removeLevel( 4 );
re_removeLevel( 4 );
re_removeLevel( 4 );
re_removeLevel( 4 );
end else begin
re_removeLevel( 4 );
re_setLevel(2,re_getLevel( 5 ) + ' - ' + re_getLevel( 4 ) + stmp3)
re_removeLevel( 3 );
re_removeLevel( 3 );
re_removeLevel( 3 );
re_removeLevel( 3 );
end;
re_setLevel(1, 'Soundtracks')
end;
if sTmp2 <> '1' then begin
re_removeLevel( 4 ); // remove the level, it used only to check genre
re_removeLevel( 4 ); // remove the level, it used for year get
re_removeLevel( 4 ); // remove the level, it used for album get
re_removeLevel( 4 ); // remove the level, it used for URL get
end else begin
re_removeLevel( 5 );
re_removeLevel( 5 );
re_removeLevel( 5 );
re_removeLevel( 5 );
end;
sTmp := Trim( re_getLevel( 3 ) );
if sTmp = '-' then begin // missing year AND album tags
re_removeLevel( 3 );
end;
until not re_Skip;
end.