diff --git a/critiquebrainz/frontend/external/musicbrainz_db/includes.py b/critiquebrainz/frontend/external/musicbrainz_db/includes.py index 9c69d245c..a54f60158 100644 --- a/critiquebrainz/frontend/external/musicbrainz_db/includes.py +++ b/critiquebrainz/frontend/external/musicbrainz_db/includes.py @@ -1,6 +1,19 @@ import critiquebrainz.frontend.external.musicbrainz_db.exceptions as mb_exceptions -RELATABLE_TYPES = ['area', 'artist', 'label', 'place', 'event', 'recording', 'release', 'release-group', 'series', 'url', 'work', 'instrument'] +RELATABLE_TYPES = [ + 'area', + 'artist', + 'label', + 'place', + 'event', + 'recording', + 'release', + 'release-group', + 'series', + 'url', + 'work', + 'instrument' +] RELATION_INCLUDES = [entity + '-rels' for entity in RELATABLE_TYPES] TAG_INCLUDES = ["tags", "user-tags"] RATING_INCLUDES = ["ratings", "user-ratings"] diff --git a/critiquebrainz/frontend/external/musicbrainz_db/place.py b/critiquebrainz/frontend/external/musicbrainz_db/place.py index 373d2fad0..815ec870f 100644 --- a/critiquebrainz/frontend/external/musicbrainz_db/place.py +++ b/critiquebrainz/frontend/external/musicbrainz_db/place.py @@ -12,19 +12,19 @@ THREAD_POOL_PROCESSES = 10 -def get_place_by_id(id): +def get_place_by_id(mbid): """Get place with the MusicBrainz ID. Args: - id (uuid): MBID(gid) of the place. + mbid (uuid): MBID(gid) of the place. Returns: Dictionary containing the place information. """ - key = cache.gen_key(id) + key = cache.gen_key(mbid) place = cache.get(key) if not place: place = _get_place_by_id( - id, includes=['artist-rels', 'place-rels', 'release-group-rels', 'url-rels'], + mbid, includes=['artist-rels', 'place-rels', 'release-group-rels', 'url-rels'], ) cache.set(key=key, val=place, time=DEFAULT_CACHE_EXPIRATION) return place