[REL] [ITA] Duplicate Movies

If you made a script you can offer it to the others here, or ask help to improve it. You can also report here bugs & problems with existing scripts.
Post Reply
fulvio53s03
Posts: 764
Joined: 2007-04-28 05:46:43
Location: Italy

[REL] [ITA] Duplicate Movies

Post by fulvio53s03 »

yet another little script to show duplicate movies: it writes a .csv file (easily managed with Microsoft Excel), showing:
- 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.

:D
fulvio53s03
Posts: 764
Joined: 2007-04-28 05:46:43
Location: Italy

Creating .amc catlog from extraction

Post by fulvio53s03 »

Thanks fo the "Code" added.
Do you think it could be possible create an .amc file from the extracted records? It could be useful to have a complete catalog to print after the extraction.
Would you give me an example (if possible)?
Bye. :ha:
antp
Site Admin
Posts: 9651
Joined: 2002-05-30 10:13:07
Location: Brussels
Contact:

Post by antp »

You can import the CSV file into a new catalog (file -> import)
But as the script does not allow to handle pictures, you cannot export pictures with the CSV file, and so not reimport them in the new catalog.
Post Reply