thank i got it working
here is the script if someone need it (maybe you have custumize it to your customfields)
Code: Select all
program MovieliciousExport;
uses
SoulSnakeUtils ;
var
xml: TJvSimpleXml;
exportxml,batch:tstringlist;
convert,actorsvalue:string;
const
savepath = 'Z:\media\Daten_2TB\movies\';
//savepath = 'C:\Users\snake\Desktop\MovieliciousExport.xml';
function ActorsToXml(actors: string): string;
var
lstActor: TStringList;
iActor,startpos: Integer;
sActor,name: string;
begin
lstActor := TStringList.Create;
lstActor.Text := stringreplace(actors,', ',#13#10);
for iActor := 0 to lstActor.Count - iActor do
begin
startpos:= pos(' (',lstActor.GetString(iActor));
name:=copy(lstActor.GetString(iActor),0,startpos-1);
sActor := ', ' + name ;
if lstActor.GetString(iActor) <> #13#10 then lstActor.SetString(iActor, sActor);
end;
Result := lstActor.Text;
lstActor.Free;
end;
procedure AddMovieData;
var
eMovie: TJvSimpleXmlElem;
seen:string;
begin
xml.Root.Items.Add('Movie');
eMovie := xml.Root.Items.GetItemNamed('Movie');
eMovie.Items.Add('MovieID');
eMovie.Items.GetItemNamed('MovieID').value := GetField(fieldnumber);
eMovie.Items.Add('Title');
eMovie.Items.GetItemNamed('Title').value := GetField(fieldtranslatedtitle);
eMovie.Items.Add('Media');
eMovie.Items.GetItemNamed('Media').value := GetField(fieldVideoFormat);
eMovie.Items.Add('Genres');
eMovie.Items.GetItemNamed('Genres').value := GetField(fieldCategory);
eMovie.Items.Add('Year');
eMovie.Items.GetItemNamed('Year').value := GetField(fieldyear);
eMovie.Items.Add('MPAA');
eMovie.Items.GetItemNamed('MPAA').value := GetCustomField('fsk');
eMovie.Items.Add('Country');
eMovie.Items.GetItemNamed('Country').value := GetField(fieldcountry);
eMovie.Items.Add('Length');
eMovie.Items.GetItemNamed('Length').value := GetField(fieldLength);
eMovie.Items.Add('Plot');
eMovie.Items.GetItemNamed('Plot').value :=GetField(fieldDescription);
eMovie.Items.Add('URL');
eMovie.Items.GetItemNamed('URL').value := GetField(fieldurl);
eMovie.Items.Add('Director');
eMovie.Items.GetItemNamed('Director').value := GetField(fielddirector);
eMovie.Items.Add('Rating');
eMovie.Items.GetItemNamed('Rating').value := GetField(fieldrating);
eMovie.Items.Add('Notes');
eMovie.Items.GetItemNamed('Notes').value := GetField(fieldcomments);
eMovie.Items.Add('Position');
eMovie.Items.GetItemNamed('Position').value := GetcustomField('pfad');
exportpicture(savepath + '12temp34\' + GetField(fieldnumber)+PictureExt);
eMovie.Items.Add('Cover');
eMovie.Items.GetItemNamed('Cover').value := GetField(fieldnumber)+PictureExt;
eMovie.Items.Add('Actors');
actorsvalue:=actorstoxml(getfield(fieldactors));
delete(actorsvalue,1,2)
eMovie.Items.GetItemNamed('Actors').value := actorsvalue;
eMovie.Items.Add('Loaned');
eMovie.Items.GetItemNamed('Loaned').value := GetField(fieldBorrower);
//eMovie.Items.Add('LoanedDate');
//eMovie.Items.GetItemNamed('LoanedDate').value := GetField();
//eMovie.Items.Add('PersonalRating');
//eMovie.Items.GetItemNamed('PersonalRating').value := GetcustomField('Prating');
eMovie.Items.Add('PurchaseDate');
eMovie.Items.GetItemNamed('PurchaseDate').value := GetField(fieldDate);
eMovie.Items.Add('Seen');
eMovie.Items.GetItemNamed('Seen').value := GetcustomField('gesehen');
end;
begin
if GetIteration = 0 then // First iteration
begin // We prepare XML
batch:=tstringlist.create;
batch.text:='mkdir ' + savepath + '12temp34';
batch.savetofile(dirapp + 'start.bat');
Launch(dirapp + 'start.bat','');
xml := TJvSimpleXml.create(nil);
xml.Root.Name := 'XMM_Movie_Database';
end;
// We add movie data
AddMovieData;
if GetIteration = GetIterationCount - 1 then // Last iteration
begin // We save XML to file and we close it
convert:=xml.savetostring;
convert:=stringreplace(convert,'iso-8859-1','utf-8');
convert:=utf8encode(convert);
//showmessage(convert);
exportxml:=tstringlist.create;
exportxml.text:=convert;
exportxml.savetofile(savepath+'12temp34\export.xml');
//xml.loadfromstring(convert);
//xml.SaveToFile(savepath)
//Launch();
batch.text:=dirapp+'7za.exe a ' + savepath + 'movies.zip ' + savepath + '12temp34\*' + #13#10 + 'rmdir /S /Q ' + savepath + '12temp34';
batch.savetofile(dirapp + 'start.bat');
Launch(dirapp + 'start.bat','');
xml.Free;
exportxml.free;
batch.free;
showmessage('FINISHED!');
end;
end.
now i have a other question because now i create a custom html template for me i have a problem
now it look like
Code: Select all
<html><head>
<style TYPE="text/css">
body { margin: 0em; padding: 0em; }
text,p,div,span,th,td,ul,li { FONT-SIZE: 10pt; FONT-FAMILY: Trebuchet MS, Verdana, Arial, Helvetica, sans-serif; color: black; background: white; }
div.header { font-size: 18pt; font-weight: bold; text-align: center; color: white; background: black;padding: 5px}
div.header2 { font-size: 10pt; font-weight: bold; text-align: center; color: yellow; background: black;padding: 5px; margin-bottom : 5px}
div.footer { font-size: 18pt; font-weight: bold; text-align: center; color: white; background: white; padding: 0px; margin-top : 5px}
hr { border: solid; border: 0; background-color: #000; color: #000; height: 3px; }
A:link { COLOR: #003399; background: white; }
A:visited { COLOR: #003399; background: white; }
A:hover { COLOR: #CC0000; background: white; }
A:active { COLOR: #CC0000; background: white; }
tr { vertical-align: top; padding : 0px; }
td.wh, table.wh { color: black; background: white; border: solid; border-color: white; vertical-align: middle; }
td.gr { color: black; background: #F5F5F5; border: solid; border-color: white; vertical-align: top; }
td.blk { color: white; background: black; border: solid; border-color: black; vertical-align: middle; }
table { color: black; background: white; border: none; }
</style></head><body>
<div class="header">$$ITEM_TRANSLATEDTITLE ($$ITEM_YEAR)</div>
<div class="header2">"$$ITEM_CF_TAGLINE"</div>
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tr>
<td class="wh" width="200"><img src="$$ITEM_PICTUREFILENAME" alt="poster" width="200" /></td>
<td>
<table border="0" cellspacing="0" cellpadding="1" width="100%">
<tr>
<td class="gr">$$LABEL_ORIGINALTITLE:</td>
<td class="wh">$$ITEM_ORIGINALTITLE</td>
</tr>
<tr>
<td class="gr" width="165">Gesehen/Nicht Gesehen:</td>
<td class="wh">$$ITEM_CF_GESEHEN</td>
</tr>
<tr>
<td class="gr" width="150">$$LABEL_RATING:</td>
<td class="wh">$$ITEM_APPR10 ($$ITEM_RATING) from $$ITEM_CF_VOTES Users</td>
</tr>
<tr>
<td class="gr">$$LABEL_COUNTRY:</td>
<td class="wh">$$ITEM_COUNTRY</td>
</tr>
<tr>
<td class="gr">FSK:</td>
<td class="wh">$$ITEM_CF_FSK</td>
</tr>
<tr>
<td class="gr">$$LABEL_LENGTH:</td>
<td class="wh">$$ITEM_LENGTHmin</td>
</tr>
<tr>
<td class="gr">$$LABEL_CATEGORY:</td>
<td class="wh">$$ITEM_CATEGORY</td>
</tr>
<tr>
<td class="gr">$$LABEL_DIRECTOR:</td>
<td class="wh">$$ITEM_DIRECTOR</td>
</tr>
<tr>
<td class="gr">$$LABEL_PRODUCER:</td>
<td class="wh">$$ITEM_PRODUCER</td>
</tr>
<tr>
<td class="gr">Studio:</td>
<td class="wh">$$ITEM_CF_STUDIO</td>
</tr>
<tr>
<td class="gr">Writer:</td>
<td class="wh">$$ITEM_CF_WRITER</td>
</tr>
</table>
</td>
</tr>
</table>
<table border="0" cellspacing="0" cellpadding="1" width="100%">
<!--<tr>
<td class="gr" width="150">$$LABEL_ACTORS:</td>
<td class="wh">$$ITEM_ACTORS</td>
</tr>-->
<tr>
<td class="gr">$$LABEL_DESCRIPTION:</td>
<td class="wh">$$ITEM_DESCRIPTION</td>
</tr>
<tr>
<td class="gr">$$LABEL_COMMENTS:</td>
<td class="wh">$$ITEM_COMMENTS</td>
</tr>
<tr>
<td class="gr" width="150">$$LABEL_URL:</td>
<td class="wh"><a href="$$ITEM_URL">$$ITEM_URL</a></td>
</tr>
<tr>
<td class="gr" width="150">Pfad:</td>
<td class="wh"><a href="$$ITEM_CF_PFAD">$$ITEM_CF_PFAD</a></td>
</tr>
</table>
<div class="footer"></div>
</body></html>
but i have a problem with the actors (that why there are deactivied)
my actor field has the folling value:
Code: Select all
Sean Penn (Paul Rivers | http://ia.media-imdb.com/images/M/MV5BMTc1NjMzMjY3NF5BMl5BanBnXkFtZTcwMzkxNjQzMg@@._V1._SY314_SX214_.jpg | http://akas.imdb.com/name/nm0000576/), Naomi Watts (Cristina Peck | http://ia.media-imdb.com/images/M/MV5BMTMyODUxOTk0MF5BMl5BanBnXkFtZTcwNjE0NDc2Mw@@._V1._SY314_SX214_.jpg | http://akas.imdb.com/name/nm0915208/), Danny Huston (Michael | http://ia.media-imdb.com/images/M/MV5BMTc0MDQyMjM2OV5BMl5BanBnXkFtZTcwNjc2NzMzMw@@._V1._SY314_SX214_.jpg | http://akas.imdb.com/name/nm0396812/), Carly Nahon (Cathy | | http://akas.imdb.comhttp://pro.imdb.com/widget/resume_redirect/), Claire Pakis (Laura | | http://akas.imdb.comhttp://pro.imdb.com/widget/resume_redirect/), Benicio Del Toro (Jack Jordan | http://ia.media-imdb.com/images/M/MV5BMTkzODQ4NzU1N15BMl5BanBnXkFtZTcwOTUzMzc5Mg@@._V1._SY314_SX214_.jpg | http://akas.imdb.com/name/nm0001125/), Nick Nichols (Boy | | http://akas.imdb.comhttp://pro.imdb.com/widget/resume_redirect/), Charlotte Gainsbourg (Mary Rivers | http://ia.media-imdb.com/images/M/MV5BNDQyMzQ5NTEzNl5BMl5BanBnXkFtZTcwNjI3NTEzNQ@@._V1._SY314_SX214_.jpg | http://akas.imdb.com/name/nm0001250/), John Rubinstein (Gynecologist | http://ia.media-imdb.com/images/M/MV5BMTcxNjM1OTk4MV5BMl5BanBnXkFtZTcwNjI1NjA2Mw@@._V1._SY314_SX214_.jpg | http://akas.imdb.com/name/nm0748270/), Eddie Marsan (Reverend John | http://ia.media-imdb.com/images/M/MV5BMjIzNjk0MTAxNV5BMl5BanBnXkFtZTcwMTA2NjQ0Mw@@._V1._SY314_SX214_.jpg | http://akas.imdb.com/name/nm0550371/), Loyd Keith Salter (Fat Man | | http://akas.imdb.comhttp://pro.imdb.com/widget/resume_redirect/), Antef A. Harris (Basketball Guy | | http://akas.imdb.comhttp://pro.imdb.com/widget/resume_redirect/)
actorname (role | actorpic | actorpage)
and now i want that in the html file it look like
actorname (with link to the page) ... role
Sean Penn ... Paul Rivers
Naomi Watts ... Cristina Peck
and so on
how can i do that
sry that i asked so many questions^^