summaryrefslogtreecommitdiffstats
path: root/addons/metadata.generic.albums/lib/wikipedia.py
blob: bfc6c318f02492b4d2c146dbf1610f01d1083fed (plain)
1
2
3
4
5
6
7
8
9
# -*- coding: utf-8 -*-
import re

def wikipedia_albumdetails(data):
    albumdata = {}
    # check in case musicbrainz did not provide a direct link
    if 'extract' in data['query']['pages'][0] and not data['query']['pages'][0]['extract'].endswith('may refer to:'):
        albumdata['description'] = re.sub('\n\n\n== .*? ==\n', ' ', data['query']['pages'][0]['extract'])
    return albumdata