English > Scripts and Templates
AllMovie+ script: Including data for custom fields
rick.ca:
The AllMovie site has been replaced by AllRovi. See AllRovi movie script.
Attached is my modification of nostra's AllMovies.com script to include additional data for custom fields. Essentially, I changed the script to gather as much data as possible from the left-hand column of the "Overview" page. At the beginning of the script, I've documented the additional custom fields necessary to accommodate this data (see below).
Warning: This script uses the standard Category and Tags fields. Ensure your Field overwrite settings are set correctly to avoid conflicts.
All of the 17 custom fields included are optional. Just add the ones you want to Preferences - Movies - Custom items. There is no need to modify the script for fields you choose not to use. The script refers to custom fields by name, so if you use a different name, you will have to change it in the script.
I've done this largely by copying and adapting parts of nostra's script without understanding exactly how or why it works. :-[ So suggestions or comments are welcome. Questions too—I love to share my confusion. ;D
Here's the documentation:
--- Code: ---CUSTOM AND NON-STANDARD FIELD MAPPINGS
All custom fields are optional. All standard fields can be suppressed using
Preferences-Plugins-Overwrite fields. If custom names are changed in PVD, they
must also be changed where they occur in the body of this script. The type of
custom field used is also somewhat a matter of personal preference. A list which
is for viewing only will do just as well in a long text as a multiselect field.
ALLMOVIE CAPTION PVD FIELD FIELD TYPE
Cast Tab Cast memo
Production Credits Tab Production Credits memo
Review Tab Review memo
Run time Original duration number
Work rating AllMovie rating rating
Attributes Attributes multiselect list
MPAA + MPAA Reasons MPAA standard (IMDb is primary source)
Category Work type select list
Color type Color type select list
Types Types multiselect list
Flags Flags multiselect list
Keywords Keywords multiselect list
Themes Category standard (sole source)
Tones Tags standard (sole source)
Moods Moods multiselect list
From book (or story) Book short text
Set in Set in multiselect list
Box office Box office standard (IMDb is primary source)
Produced by Studio standard (IMDb is secondary source)
Release (or Premiere) Released short text
Released by Released by short text
(Date) Updated short text
--- End code ---
Current version attached:
09/24/2010 – 0.1.2.2 – Modified ParseCast procedure to save entire Cast tab to custom memo field, as well as individual actors.
[attachment deleted by admin]
rick.ca:
Now adds current date to Updated field.
The updated script is attached to my original message above.
darichman:
Rick, this is great - thanks for sharing.
Just wondering, do you mainly use allmovies for your metadata? I was trialling a system with custom fields a while ago to attempt to maintain both IMDb and AMG fields in the same database (Used standard fields for IMDb and a whole bunch of custom fields for AMG - AMG Director, AMG Synopsis etc etc). It was getting a bit unwieldy.
There are a few situations where AMG is incomplete compared to IMDb or vice versa... what's your system?
darichman:
Some feedback... works great! A few little niggly bits I've noticed so far...
1. Box Office doesn't format correctly in the standard field. Works fine as a "short text" custom entry
--- Code: --- //Box office
AddCustomFieldValueByName('Box Office', HTMLValues(HTML,
'<span>Box Office</span>', '</table>',
'<li>', '</li>',
', ', EndPos));
--- End code ---
2. Your MPAA + Reason formatting works okay, but if there is no reason listed, you get an output of "Rated M for ." etc
3. I added support for the "Region" field in AMG. It's being used more and more frequently on the site, but many older movies don't have it populated.
--- Code: --- //Region
AddCustomFieldValueByName('Region', HTMLValues2(HTML,
'<span>Premiere</span>', '</table>',
'<a href="', '</a>',
', ', EndPos));
--- End code ---
4. I seem to get a rating of 10 for every movie... must have a closer look.
Also, I'm not sure if it was you or Nostra who added the Reviews and Producion Credits functionality, but that's awesome - thanks :)
rick.ca:
--- Quote ---Rick, this is great - thanks for sharing.
--- End quote ---
You're welcome. It was painful, but I figured it was my turn. ;)
--- Quote ---Just wondering, do you mainly use allmovies for your metadata?
--- End quote ---
I use both IMDb and allmovies together—usually run in a batch. IMDb goes first, because it is generally more complete. I let it handle all the people. You can see from my documentation where I use allmovie data to overwrite standard fields which may have been populated by the IMDb plugin. The rest goes into custom fields. As you probably know from doing this yourself, my approach in modifying the script was just to grab whatever I could from the stuff listed in the right-hand column of the page. I do actually have all those custom fields in my database, but only for the sake of being complete. The data elements I appreciate most are the Synopsis and Review (my original reason for going to allmovies), Tones (which I find gives a really good indication of how a movie feels), and perhaps Attributes. The rest is nice to have, but not critical.
My preferences and my skin design probably feed off each other. With that in mind, I'll attach some screenshots so you can see what I mean. We don't yet (as of 0.9.9.4) have the ability to change the placement of custom fields—they're still just dumped into the custom section of the skin. This is why I'm very deliberately placing some allmovie data into standard fields—so I can place them where I want them in my skin. Also, you may note most of the list data goes into Multiselect list fields, even thought they may look better as List or String fields. This is because I don't care so much about looking at them—I'd rather have them take up less space, and be used primarily as a means of grouping.
When I was doing this before, I suppose it got a bit unwieldy. Redoing the script, however, forced me to rethink what I was doing and why. Now it seems to work quite well. I do have to make sure my Overwrite field settings are correct—and stay that way. That can be nuisance when a plugin or script is used for more than one thing (e.g., movies and series). BTW, I think I have nostra partially committed to implementing my fix for that in version 2.0. ;D
[attachment deleted by admin]
Navigation
[0] Message Index
[#] Next page
Go to full version