Ok I got it figured out with help from someone on the Ant Movie Catalog forums.
I updated my IMDB script by adding this:
- Code: Select all
// Release Date
if CanSetField(fieldSource) then
begin
Value := TextBetween(PageText, '<h5>Release Date:</h5>', '<');
Value := TextBetween(Value, #13#10, #13#10);
Value := TextAfter(Value, ' ');
Month := TextBefore(Value, ' ', '');
case Month of
'January': Month := '01';
'February': Month := '02';
'March': Month := '03';
'April': Month := '04';
'May': Month := '05';
'June': Month := '06';
'July': Month := '07';
'August': Month := '08';
'September': Month := '09';
'October': Month := '10';
'November': Month := '11';
'December': Month := '12';
end;
Value := RemainingText;
Year := TextBefore(Value, ' ', '');
Value := Year + Month;
SetField(fieldSource, Value);
end;
I added it right after the Directors section of the script and had to define the variables "Month" and "Year" as strings. You do this on the part of the script that looks like this:
- Code: Select all
// ***** analyzes the page containing movie information *****
procedure AnalyzeMoviePage(PageText: string);
var
Value, Value2, Value3, FullValue: string;
I just changed the last line to read:
- Code: Select all
Value, Value2, Value3, Year, Month, FullValue: string;
Then I changed my MoviesTemplate.xml file in Plugins/xant to look like this:
- Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<database>
<sortorder>number</sortorder>
<sortable>
<sort>actors</sort>
<sort>title</sort>
<sort>sorttitle</sort>
<sort>genre</sort>
<sort>director</sort>
<sort>year</sort>
<sort>rating</sort>
<sort>name</sort>
<sort>number</sort>
<sort>starimage</sort>
<sort>borrower</sort>
<sort>HQ</sort>
<sort>medialabel</sort>
<sort>source</sort>
<sort>yearmonth</sort>
</sortable>
<template/>
<paths>
<path/>
</paths>
<item>
<parameter>$$ITEM_URL</parameter>
<coverart>$$ITEM_PICTUREFILENAME</coverart>
<display>$$ITEM_ORIGINALTITLE</display>
<information>
<name>$$ITEM_ORIGINALTITLE</name>
<title>$$ITEM_ORIGINALTITLE</title>
<sorttitle>$$ITEM_ORIGINALTITLE</sorttitle>
<director>$$ITEM_DIRECTOR</director>
<runtime>$$ITEM_LENGTH</runtime>
<plot>$$ITEM_DESCRIPTION</plot>
<actors>$$ITEM_ACTORS</actors>
<year>$$ITEM_YEAR</year>
<genre>$$ITEM_CATEGORY</genre>
<rating>$$ITEM_RATING/10</rating>
<number>$$ITEM_NUMBER</number>
<borrower>$$ITEM_BORROWER</borrower>
<starimage>skin://buttons/stars/Stars5-$$ITEM_RATING.png</starimage>
<HQ>skin://buttons/$$ITEM_MEDIA.png</HQ>
<medialabel>$$ITEM_MEDIA</medialabel>
<yearmonth>$$ITEM_SOURCE</yearmonth>
</information>
</item>
</database>
I added the 2 lines referring to "yearmonth" (I tried to bold them but could not figure it out
)
Now what I get in the Source field of Ant is for example: 200805 for May of 2008.
So now I can just do a "set sort order" of "-1:yearmonth" and I get my movies sorted with the newest released movies first
Just figured I would share in case anyone else want to do the same.
Happy Holidays!!!!