You are not logged in.
Pages: 1
It would be nice when renaming folders to be able to use meta tag info from the first file in the folder. For example I have mp3 folders in the format
Artist - Album
and wish to rename them
Artist - Album (year)
Offline
Good news for you - it is possible!
For the starters, you can have a look at the similar problem and solution here:
Same name for all files as an existing file in the folder
And then, here is the modified script from the topic above, to suite your needs (look below). This code will find a first file in the folder which matches MASK, and will append value of a TAG of that file to the folder's name.
const
MASK = '*.mp3';
TAG = 'ID3_Year';
var
MasterFile: WideString;
function FindMasterFile(const Folder: WideString): WideString;
var
Files: TStringsArray;
begin
Result := '';
SetLength(Files, 0);
WideScanDirForFiles(Folder, Files,
False, False, False, MASK);
if Length(Files) > 0 then
Result := Files[0];
end;
begin
if WideDirectoryExists(FilePath) then
begin
MasterFile := FindMasterFile(FilePath);
if MasterFile <> '' then
FileName := FileName + CalculateMetaTag(MasterFile, TAG);
end;
end.
Offline
Ah thank you very much. Super program btw, puts others to shame
Offline
Pages: 1