
class crew():
    
    def __init__(self):
        pass

    def process(self, crewdata, seriesid):
        crewlist = []
        try:
            for crewmember in crewdata:
                cmember = {}
                cmember['seriesid'] = seriesid
                cmember['crewid'] = crewmember['person']['id']
                cmember['type'] = crewmember['type']
                cmember['url'] = crewmember['person']['url']
                cmember['name'] = crewmember['person']['name']
                cmember['countryid'] = '0'
                cmember['birthday'] = crewmember['person']['birthday']
                cmember['deathday'] = crewmember['person']['deathday']
                cmember['gender'] = crewmember['person']['gender']
                if crewmember['person']['image']:
                    cmember['medium'] = crewmember['person']['image']['medium']
                    cmember['original'] = crewmember['person']['image']['original']
                else:
                    cmember['medium'] = None
                    cmember['original'] = None
                if crewmember['person']['_links']:
                    cmember['apilink'] = crewmember['person']['_links']['self']['href']
                else:
                    cmember['apilink'] = None
                crewlist.append(cmember)
        except Exception as e:
            print('Unable to process crew information for seriesid: ' + str(seriesid))
        else:
            return(crewlist)
    
    def listcredits(self, seriesid):
        pass
    
    def __del__(self):
        pass
    