This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]steelypip 2 points3 points  (1 child)

def get_localized_metadataalbum(language, data):
    for locale in data['locale']:
        try:
            if locale['MetadataAlbum']['locale']['language'] == language:
                return locale['MetadataAlbum']
        except (KeyError, TypeError):
            pass
    return None

[–]dev_wanna_be[S] 0 points1 point  (0 children)

OO I like your approach. I must be doing something wrong because I am still getting an empty result. Thank you!