Exporting empty files?
Exporting empty files?
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,
thanks in advance,
A short script should do the job:
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 ? : /)
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.
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,
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,
Did you read the topic viewtopic.php?t=4146 or tried the new XBMC-nfo script ?
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:
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
e.g.
results in this xml structure:
Code: Select all
lst.Text := StringReplace(actors, ', ', #13#10);
And you can change the result on line
Code: Select all
s := ' <actor><name>' + lst.GetString(i) + '</name></actor>';
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>