Exporting empty files?

If you need help on how to use the program
Post Reply
fidoboy
Posts: 13
Joined: 2006-11-01 12:22:25

Exporting empty files?

Post by fidoboy »

I'm trying to use Ant Movies with XBMC, and i need to create a folder with all my movies in database containing only empty files. For example if i have a movie named "The Movie" i want to create a file named "the movie.avi" and do this for all my database entries. How can i do this?

thanks in advance,
bad4u
Posts: 1148
Joined: 2006-12-11 22:54:46

Post by bad4u »

A short script should do the job:

Code: Select all

program export_empty_files;
var
  aList: TStringList;
  value: string;
begin
  aList := TStringList.Create;
  value := GetField(fieldTranslatedTitle);
  value := AnsiLowerCase(value);
  aList.SaveToFile(dirApp + '\export\' + value + '.avi');
  aList.Free;
end.
Script reads field translated title and writes empty files to the folder \export\ within AMC folder. If it does not exists you need to make such folder before you run the script. Script does not check for and will stop if you have special characters on your titles that are not allowed for folder names (like ? : /)
fidoboy
Posts: 13
Joined: 2006-11-01 12:22:25

Post by fidoboy »

Many thanks! Another question, how can i export actors from each movie?

I must export to a XML file containing this structure:

sx:=sx+' <actor>'+#13#10;
sx:=sx+' <name>WHATHERE</name>'#13#10;
sx:=sx+' <role></role>'#13#10;
sx:=sx+' </actor>'+#13#10;

I know that i can get the field this way: GetField(fieldActors) but how can i strip the names using a delimiter??

regards,
bad4u
Posts: 1148
Joined: 2006-12-11 22:54:46

Post by bad4u »

Did you read the topic viewtopic.php?t=4146 or tried the new XBMC-nfo script ?
fidoboy
Posts: 13
Joined: 2006-11-01 12:22:25

Post by fidoboy »

Yes, i'm now using that script, thanks! but i'm trying to improve it, because currently, i can't get the thumbnails for each movie and also i want to know the MediaCode from XBMC to locate my disc (i have each disc labeled with a number)

regards,
bad4u
Posts: 1148
Joined: 2006-12-11 22:54:46

Post by bad4u »

Well, Antoine wrote a short function to retrieve actors list to XML format on the topic mentioned above. And on the XMBC script you can see how it works. Script works for actor lists that use linebreak or comma as delimiter, you can change delimiters here:

Code: Select all

lst.Text := StringReplace(actors, ', ', #13#10); 
Simply change that line or add another line for other delimiters (original delimiters have to be replaced by linebreaks).

And you can change the result on line

Code: Select all

s := '   <actor><name>' + lst.GetString(i) + '</name></actor>';
e.g.

Code: Select all

s := '   <actor>' + #13#10 + ' <name>' + lst.GetString(i) + '</name>' + #13#10 + ' <role></role>' + #13#10 + '</actor>';

results in this xml structure:

Code: Select all

 <actor>
 <name>Name</name>
 <role></role>
 </actor>
fidoboy
Posts: 13
Joined: 2006-11-01 12:22:25

Post by fidoboy »

Thanks bad4u, do u have any idea about how can i get the media code from XBMC?

regards,
bad4u
Posts: 1148
Joined: 2006-12-11 22:54:46

Post by bad4u »

I'm not even sure what media code from XBMC exactly is, as I don't have a XBox.
fidoboy
Posts: 13
Joined: 2006-11-01 12:22:25

Post by fidoboy »

Well, actually you can run XBMC on windows, linux or even OSX platform. In fact, i'm running it on windows vista
bad4u
Posts: 1148
Joined: 2006-12-11 22:54:46

Post by bad4u »

Interesting, didn't know about that. But nevertheless I don't know anything about XBMC and its media codes ;)
Post Reply