<commit_before>'''
Created on 30/04/2011

@author: mikel
'''
from _spotify import album as _album

from spotify.utils.decorators import synchronized

from spotify import artist

import binascii



class AlbumType:
    Album = 0
    Single = 1
    Compilation = 2
    Unknown = 3



class Album:
    __album_struct = None
    
    
    def __init__(self, album_struct):
        self.__album_struct = album_struct
    
    
    @synchronized
    def is_loaded(self):
        return _album.is_loaded(self.__album_struct)
    
    
    @synchronized
    def is_available(self):
        return _album.is_available(self.__album_struct)
    
    
    @synchronized
    def artist(self):
        return artist.Artist(_album.artist(self.__album_struct))
    
    
    @synchronized
    def cover(self):
        res = _album.cover(self.__album_struct).contents
        if res is not None:
            return binascii.b2a_hex(res.value)
    
    
    @synchronized
    def name(self):
        return _album.name(self.__album_struct)
    
    
    @synchronized
    def year(self):
        return _album.year(self.__album_struct)
    
    <commit_msg>spotify: album: fixed bug in cover().<commit_after>'''
Created on 30/04/2011

@author: mikel
'''
from _spotify import album as _album

from spotify.utils.decorators import synchronized

from spotify import artist

import binascii



class AlbumType:
    Album = 0
    Single = 1
    Compilation = 2
    Unknown = 3



class Album:
    __album_struct = None
    
    
    def __init__(self, album_struct):
        self.__album_struct = album_struct
    
    
    @synchronized
    def is_loaded(self):
        return _album.is_loaded(self.__album_struct)
    
    
    @synchronized
    def is_available(self):
        return _album.is_available(self.__album_struct)
    
    
    @synchronized
    def artist(self):
        return artist.Artist(_album.artist(self.__album_struct))
    
    
    @synchronized
    def cover(self):
        res = _album.cover(self.__album_struct).contents
        if res is not None:
            return binascii.b2a_hex(buffer(res))
    
    
    @synchronized
    def name(self):
        return _album.name(self.__album_struct)
    
    
    @synchronized
    def year(self):
        return _album.year(self.__album_struct)
    
    
{'fraction_non_alphanumeric': 0.07725694444444445, 'fraction_numerical': 0.011284722222222222, 'mean_word_length': 2.3213256484149856, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7420991', 'n_tokens_mistral': 756, 'n_tokens_neox': 721, 'n_words': 161}