Wrote this quick document on aiding in understanding how to make the most out of using Xant.
http://www.xlobby.com/files/Marbles_00/Understanding%20Xant.pdf
Enjoy.
MovieURL := '\\tower\\Movies\\' + MovieName + '.mkv';
// Rating
LineNr := FindLine('<b>Rating:</b>', Page, 0);
if LineNr > -1 then
begin
Line := Page.GetString(LineNr);
Value := + Trim(TextBetween(Line, '<b>Rating:</b>', '<br />'));
SetField(fieldBorrower, Value);
end;
var
MovieName: string;
extras: string;
var
MovieName: string;
extras: string;
CategoryName: string;
// Rating
LineNr := FindLine('<b>Rating:</b>', Page, 0);
if LineNr > -1 then
begin
Line := Page.GetString(LineNr);
Value := + Trim(TextBetween(Line, '<b>Rating:</b>', '<br />'));
SetField(fieldBorrower, Value);
end;
// Rating
LineNr := FindLine('<b>Rating:</b>', Page, 0);
if LineNr > -1 then
begin
Line := Page.GetString(LineNr);
Value := + Trim(TextBetween(Line, '<b>Rating:</b>', '<br />'));
SetField(fieldBorrower, Value);
if Value = 'G' then
CategoryName := 'Childrens';
if Value = 'PG' then
CategoryName := 'Childrens';
if Value = 'PG-13' then
CategoryName := 'Adult';
if Value = 'R' then
CategoryName := 'Adult';
if Value = 'NR' then
CategoryName := 'Adult';
if Value = '' then
CategoryName := 'Adult';
SetField(fieldtranslatedTitle, CategoryName );
end;
var
MovieName: string;
extras: string;
var
MovieName: string;
extras: string;
MovieRating: string;
URLName: string;
MovieName2: string;
begin
MovieName2 := MovieName;
MovieName2 := StringReplace(MovieName2, '+', ' ');
MovieRating := GetField(fieldBorrower);
if MovieRating = 'children' then
URLName := '\\tower\disk2\' + MovieRating + '\' + MovieName2 + '\Video_TS\video.ifo';
if MovieRating = 'mature' then
URLName := '\\tower\disk2\' + MovieRating + '\' + MovieName2 + '\Video_TS\video.ifo';
if MovieRating = 'hidef' then
URLName := '\\tower\disk2\' + MovieRating + '\' + MovieName2 + '\' + MovieName2 + '.mkv';
if MovieRating = 'recordedtv' then
URLName := '\\tower\disk1\' + MovieRating + '\' + MovieName2 + '\' + MovieName2 + '.mpg';
SetField(fieldURL, URLName );
end;
// URL
begin
MovieRating := GetField(fieldBorrower);
if MovieRating = 'children' then
URLName := '\\tower\disk1\' + MovieRating + '\' + MovieName + '\Video_TS\video_ts.ifo';
if MovieRating = 'mature' then
URLName := '\\tower\disk1\' + MovieRating + '\' + MovieName + '\Video_TS\video_ts.ifo';
if MovieRating = 'hidef' then
URLName := '\\tower\disk2\' + MovieRating + '\' + MovieName + '\' + MovieName + '.mkv';
if MovieRating = 'recordedtv' then
URLName := '\\tower\disk1\' + MovieRating + '\' + MovieName + '\' + MovieName + '.mpg';
SetField(fieldURL, URLName );
end;
//Media Label
begin
MovieRating := GetField(fieldBorrower);
if MovieRating = 'children' then
MediaLabel := '\\tower\disk1\' + MovieRating + '\' + MovieName + '\fanart.jpg';
if MovieRating = 'mature' then
MediaLabel := '\\tower\disk1\' + MovieRating + '\' + MovieName + '\fanart.jpg';
if MovieRating = 'hidef' then
MediaLabel := '\\tower\disk2\' + MovieRating + '\' + MovieName + '\fanart.jpg';
if MovieRating = 'recordedtv' then
MediaLabel := '\\tower\disk1\' + MovieRating + '\' + MovieName + '\fanart.jpg';
SetField(fieldMedia, MediaLabel );
end;