예제 #1
0
파일: convert.py 프로젝트: roni-5/sir
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
예제 #2
0
파일: convert.py 프로젝트: mineo/sir
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
예제 #3
0
파일: convert.py 프로젝트: roni-5/sir
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
예제 #4
0
파일: convert.py 프로젝트: mineo/sir
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