def convert_medium_list_from_track(obj): """ :type obj: :class:`mbdata.models.Track` """ ml = models.medium_list(count=len(obj.medium.release.mediums)) ml.add_medium(convert_medium_from_track(obj)) tracks = 0 for medium in obj.medium.release.mediums: tracks += int(medium.track_count) ml.set_track_count(tracks) return ml
def convert_medium_list(obj): """ :type obj: :class:`[mbdata.models.Medium]` """ ml = models.medium_list() [ml.add_medium(convert_medium(m)) for m in obj] ml.set_count(len(obj)) tracks = 0 for medium in obj: tracks += int(medium.track_count) ml.set_track_count(tracks) return ml
def convert_medium_list(obj): """ :type obj: :class:`[mbdata.models.Medium]` """ ml = models.medium_list(count=len(obj)) [ml.add_medium(convert_medium(m)) for m in obj] tracks = 0 for medium in obj: tracks += int(medium.track_count) ml.set_track_count(tracks) return ml