) if e_movie_created: print "Movie Created" for company in l_movie["production_companies"]: e_company = MovieEntityGenerator._create_company_recipient(company) e_movie.recipient.add(e_company) return e_movie @staticmethod def recipient_create(title, limit=1): l_companies = MovieEntityGenerator.recipient_lookup(title, limit=limit) e_companies = [] for company in l_companies: e_companies.append(MovieEntityGenerator._create_company_recipient(company)) return e_companies @staticmethod def _create_company_recipient(company): (_, e_company, _) = MovieEntityGenerator.db_create_recipient( company["id"], company["name"], RecipientReference.TYPE_THEMOVIEDB, Recipient.TYPE_MOVIE_PRODUCTION_COMPANY ) return e_company if settings.FRUCTUS_KEYS: registry.register(MovieEntityGenerator())
# Clean up recording data if 'release-list' in recording: recording.pop('release-list') else: break return _recording, _results @staticmethod def _parse_releases(releases): _release = None _results = [] for release in releases: if MusicEntityGenerator._validate_score(_release, release): if _release is None: _release = release # Find all valid releases (Official releases) if MusicEntityGenerator._valid_release(release): _results.append((release, release['label-info-list'])) _artist = musicbrainzngs.get_artist_by_id( _release['artist-credit'][0]['artist']['id'] )['artist'] return _artist, _results if settings.FRUCTUS_KEYS: registry.register(MusicEntityGenerator())