pculture/miro — pull request #218 by bendk (2012-02-23 22:32:15+00:00)
Title: bz18670: don't run echonest twice for items.

The problem we are trying to solve is this:
- We start echonest lookups for a bunch of items
- We change set_net_lookup to False for all items
- This cancels it for all items that are queued up, but it doesn't cancel it
for items currently being processed (both ones that we are running
codegens for and ones that we are doing HTTP requests for).
- Soon after, we change set_net_lookup to True for all items
- For those items that were processing, we now have 2 echonest requests
going. Eventually this results in us getting an integrity error when we
try to add 2 rows to the metadata table with the same path/source

Added a couple pieces of code to deal with this:
- In MetadataManager check if we are expecting metadata for a source and
don't process it if not.
- In _EchonestProcessor track which paths we are working on and ignore
results for paths that have been removed.