- The titlle of the duplicated movies
- both fieldmedia of the movies (where I stored the classification of the movies)
- both fieldsize of the movies
--------------------------------------------------------------------
Code: Select all
(***************************************************
Ant Movie Catalog importation script
www.antp.be/software/moviecatalog/
[Infos]
Authors=Fulvio53s03
Title=trova Duplicati ITA
Description=Trova film duplicati in ordine di titolo tradotto
Site=
Language=?
Version=1.0
Requires=3.5
Comments=
License=GPL
GetInfo=0
[Options]
TitleToUse=2|1|1=Use original title|2=Use translated title|3=Check both titles
IgnoreCase=1|1|0=Case sensitive: Keep the uppercase/lowercase characters as different|1=Case insensitive: Consider "TITLE" as identical to "Title" or "title"
***************************************************)
program FindDup;
uses
StringUtils1;
var
MovList: TStringList;
DupList: TStringList;
CurTitle: string;
CurLabel: string;
Cursize: string;
OldLabel: string;
OldSize: string;
ResultPath: string;
TitleExp: string;
begin
if StringUtils1_Version < 3 then
begin
ShowMessage('File "stringutils1.pas" is too old, please download a new version of it');
Error;
end;
if ResultPath = '' then
begin
ResultPath := 'c:\duplicates.csv';
Input('Find Duplicates', 'Store results to:', ResultPath);
end;
if MovList = nil then
MovList := TStringList.Create;
if DupList = nil then
DupList := TStringList.Create;
case GetOption('TitleToUse') of
1: CurTitle := GetField(fieldOriginalTitle);
2: CurTitle := GetField(fieldTranslatedTitle);
3: CurTitle := GetField(fieldOriginalTitle) + ' | ' + GetField(fieldTranslatedTitle);
else
Error; // wrong option
end;
if GetOption('IgnoreCase') = 1
then
begin
CurTitle := AnsiLowerCase(CurTitle);
CurLabel := getField(fieldMedia);
CurSize := getField(fieldSize);
TitleExp := OldLabel + ';' + OldSize + ';' + CurLabel + ';' + CurSize + ';' + CurTitle;
end
if FindFullLine(CurTitle, MovList, 0) <> -1
then // film uguale
DupList.Add(TitleExp)
else
begin
MovList.Add(CurTitle);
end
OldLabel := CurLabel;
OldSize := CurSize;
DupList.SaveToFile(ResultPath); //scrivi
end.
The script can be easily managed adding new fields. if necessary.
Thanks.
