Custom Metadata Retriever
I wasn't satisfied with the metadata retrieval of some of the backend services, so I cobbled together the existing Yahoo! Music service with a brand new Amazon Webservice XML parser. It uses Amazon for the album info, and Yahoo for the artists. We recently added Rhapsody as a backup to the Yahoo artist retrieval.
The purpose of this extension is to allow Jinzora to download album info, including cover image, reviews and tag data and artist image and bio that are stored in your media library and shown by Jinzora.
Features
Album Info Retrieval
Retrieves album metadata from Amazon using their webservices API and XML data retrieval.
Album Tagging
If you add any of the following tags to an album name inside of [square] brackets, it will modify your search criteria on the fly. The following tags are supported:
- [Soundtrack] - Changes the album, artist to a common name used by soundtrack releases.
- [Various] - Assumes the album is released by various artists and will replace the album artist appropriately.
- [Compilation] - Same as Various
- [Single] - No current special matching, but may have a future feature add-on.
- [YYYY] - If a year tag is used, the system will attempt to match the release year of the album and assign a higher weight. Works well for artists that release multiple albums of the same name.
- [IMPORT] - Any other meta tags will be tried to be matched against Amazon's own use of these tags. If they match, it will give a higher search result weighting.
- [UK] - Coming soon: Using a two letter country code will allow the retriever to modify the search for a different country's Amazon library. Supported codes will be US, CA, UK, FR, DE, and JP.
Excact or Fuzzy Searches
Dynamic search lists look for album information using exact vs. fuzzy searches.
Fuzzy search uses various methods of reducing search terms in artist and album names to facilitate better matches.
Search result matching is weighted, giving exact matches with required data the highest priority.
- Exact searches are weighted highest.
- Cross-referenced matches further amplify the weight.
- Positive exact matches prevent further searching.
- Search through Amazon result pages automatically (3 pages deep, configurable).
Album Cover Image Retrieval
Extracts images starting with Amazon's largest image and falling back to smaller ones.
Album Review Retrieval
Extracts the editorial review from Amazon's reviewers (does not use customer reviews).
Album Rating Retrieval
Utilizes the Amazon client rating system to capture ratings. Note: These ratings tend to be high as they are dependent on user based reviews.
Other Features
- Can set release years. Note: Amazon's year listings based on publication year of that edition of the album, not the original release year of the record.
- PHP4 and PHP5 version compatible (PHP4 uses pure PHP XML parser and requires XML expat library).
- Attempts to search on various/soundtracks based on album names.
- UTF8 encoding/decoding of search results for proper DB entry. Smart searching on UTF normalized strings.
Artist Info Retrieval
Retrieves artist metadata from Yahoo! Music or Rhapsody.
- Performs an artist search and parses HTML output for results.
- Extracts Artist images in Yahoo!/Rhapsody format (300x180).
- Extracts Artist biography (often identical to AllMusic.com).
- Does not require XML parsers.
- UTF8 encoding/decoding of search results for proper DB entry. Smart searching on UTF normalized strings.
Installation
Requirements
Identical to Jinzora's requirements: A web server with support for PHP 4.2 or higher. PHP 5 is also supported.
For PHP 5 SimpleXML preferred, but this extension can also use XML DOM parser.PHP 4 requires XML DOM library to be installed. Note, PHP4 support uses a SimpleXML external library in pure PHP. This is a bit slower than the PHP5 method of using SimpleXML natively in the PHP code.
Instructions
The download package contains the correct libraries and paths needed to get the component installed.
When extracted, the files will be created in a directory called "custom". Copy the package files from this extracted directory to the web directory that contains Jinzora. Everything should go where it needs to.
If you are using PHP5, you probably don't actually need anything in the "lib" directory. If you need to unpack things manually, this is where each file should go; Just replace _INSTALL_PATH_ with the path to your Jinzora root directory:
- _INSTALL_PATH_/lib/simplexml
- _INSTALL_PATH_/lib/utfnormal
- _INSTALL_PATH_/services/services/metadata/custom.php
Known Issues/Feature Requests
- If MP3 tagging is enabled, the performance of the metadata program is significantly reduced.
- Amazon now supports customer images for products. These often contain good album art when it is missing from the Amazon image library. I am working on a way to retrieve this information.
- Ability to use alternate music libraries from Amazon (US, Canada, UK, Japan).
- Ability to configure plugin from JZ interface.
Author Bio
Fred Hirsch uses Jinzora as an internal music delivery system for his home LAN (6 users). He is currently working on an XHTML/CSS compliance template for Jinzora. Hopefully this will provide a good basis for building future Jinzora interfaces using more modern web standards.
Releases
Changelog for Custom Metadata Retriever 1.2.0 beta 2
Changelog for Custom Metadata Retriever 1.1.2.
