English > Scripts and Templates

AllRovi movie script

<< < (5/26) > >>

rick.ca:

--- Quote from: Ivek23 on July 12, 2011, 07:40:58 am ---Happens now, the rating here...
--- End quote ---

Try this...


--- Code: ---//Rovi Rating
 TmpStr := Trim(HTMLValues(HTML,
'<dt>rovi rating</dt>',  '</dd>',
'<li class="star ', '"></li>',
', ', EndPos));

 L := Length(TmpStr);
 H := LastPos('half', TmpStr);
 if H = 0 then
R := (L + 2)/3
 else
R := (L + 2)/3 - 1;

 AddCustomFieldValueByName('Rovi rating', IntToStr(R));
 LogMessage('Rovi rating: ' + IntToStr(R));

--- End code ---

Be sure to define L, H and R as integers (I just added them to the preceding 'var' statement). This converts 1 to 5 stars to a number from 1 to 10 for storing in a custom Rating field named "Rovi rating." I suppose we should add the option to save it in [orating] as well.

This works for 95% of movies. Unfortunately, I have no idea why it doesn't for the other 5%. They all have ratings, and I can't see any difference in the source. Some examples...

Age of Gold (1930)
Aileen Wuornos: The Selling of a Serial Killer (1992)
All That Heaven Allows (1955)
Along Came a Spider (2001)
Asthenic Syndrome (1989)
Atalante (1934)

Please have a look and see if you can figure it out. Or maybe just confirm that the error rate is really as low as it seems to be—and then we just won't tell anyone about it. ;)

Ivek23:

--- Quote from: rick.ca on July 12, 2011, 01:13:25 pm ---
--- Quote from: Ivek23 on July 12, 2011, 07:40:58 am ---Happens now, the rating here...
--- End quote ---

Try this...


--- Code: ---//Rovi Rating
 TmpStr := Trim(HTMLValues(HTML,
'<dt>rovi rating</dt>',  '</dd>',
'<li class="star ', '"></li>',
', ', EndPos));

 L := Length(TmpStr);
 H := LastPos('half', TmpStr);
 if H = 0 then
R := (L + 2)/3
 else
R := (L + 2)/3 - 1;

 AddCustomFieldValueByName('Rovi rating', IntToStr(R));
 LogMessage('Rovi rating: ' + IntToStr(R));

--- End code ---

Be sure to define L, H and R as integers (I just added them to the preceding 'var' statement). This converts 1 to 5 stars to a number from 1 to 10 for storing in a custom Rating field named "Rovi rating." I suppose we should add the option to save it in [orating] as well.

This works for 95% of movies. Unfortunately, I have no idea why it doesn't for the other 5%. They all have ratings, and I can't see any difference in the source. Some examples...

Age of Gold (1930)
Aileen Wuornos: The Selling of a Serial Killer (1992)
All That Heaven Allows (1955)
Along Came a Spider (2001)
Asthenic Syndrome (1989)
Atalante (1934)

Please have a look and see if you can figure it out. Or maybe just confirm that the error rate is really as low as it seems to be—and then we just won't tell anyone about it. ;)

--- End quote ---

Certainly not at my work.

I added a DVD Releases namely,work does not transfer data, Awards I did not and will not even add, unless of course it would Nostra added, because this is my last version, except for some adjustments of course.

Notice:
Adding in the first post new AllRovi Script Version 0.1.0.5

Ivek23:

--- Quote ---Awards I did not and will not even add,
--- End quote ---

Even in the old script AllMovie Awards were not there


--- Code: ---//Rovi Rating
 TmpStr := Trim(HTMLValues(HTML,
'<dt>rovi rating</dt>',  '</dd>',
'<li class="star ', '"></li>',
', ', EndPos));

 AddCustomFieldValueByName('Rovi rating', TmpStr );
--- End code ---

This code is for me better info display data in the previous code, but I could not find anything, because I always had a log file reported error, which I could not figure out what was written.

rick.ca:

--- Quote from: Ivek23 on July 12, 2011, 04:52:28 pm ---Certainly not at my work.
--- End quote ---

I don't understand. Your code is incomplete. The result has to be a numeric which can saved in a Rating (i.e., "stars") field. My code works perfectly except for a small portion of movies.


--- Quote ---This code is for me better info display data in the previous code, but I could not find anything, because I always had a log file reported error, which I could not figure out what was written.
--- End quote ---

That's fine for your own debugging, but it shouldn't be in the final script.


--- Quote ---Awards I did not and will not even add
--- End quote ---

I don't care. I probably won't use Awards or Releases. I only suggested they be added because I thought you would want them, and assumed the coding might be similar to that used for Cast & Crew.


I'll test your DVD Releases change, add my Rovi rating section, and post a new version later today.

Ivek23:

--- Quote ---I'll test your DVD Releases change, add my Rovi rating section, and post a new version later today.
--- End quote ---

I'll wait for your new version and then I will tomorrow or some day later helped, in my strength and knowledge to solve the problem by Rating.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version