Exemplo n.º 1
0
def convert_recording(obj):
    """
    :type obj: :class:`sir.schema.modelext.CustomRecording`
    """
    recording = models.recording()
    recording.set_id(obj.gid)
    recording.set_title(obj.name)

    recording.set_artist_credit(convert_artist_credit(obj.artist_credit))

    if obj.comment is not None and obj.comment != "":
        recording.set_disambiguation(obj.comment)

    recording.set_length(obj.length)

    if len(obj.isrcs) > 0:
        recording.set_isrc_list(convert_isrc_list(obj.isrcs))

    if len(obj.tags) > 0:
        recording.set_tag_list(convert_tag_list(obj.tags))

    if len(obj.tracks) > 0:
        recording.set_release_list(
            convert_release_list_for_recordings(obj.tracks))

    if obj.video:
        recording.set_video("true")

    return recording
Exemplo n.º 2
0
Arquivo: convert.py Projeto: mineo/sir
def convert_recording(obj):
    """
    :type obj: :class:`sir.schema.modelext.CustomRecording`
    """
    recording = models.recording(id=obj.gid, title=obj.name,
                                 artist_credit=convert_artist_credit(obj.artist_credit))  # noqa

    if obj.comment is not None and obj.comment != "":
        recording.set_disambiguation(obj.comment)

    recording.set_length(obj.length)

    if len(obj.isrcs) > 0:
        recording.set_isrc_list(convert_isrc_list(obj.isrcs))

    if len(obj.tags) > 0:
        recording.set_tag_list(convert_tag_list(obj.tags))

    if len(obj.tracks) > 0:
        recording.set_release_list(
            convert_release_list_for_recordings(obj.tracks))

    if obj.video:
        recording.set_video("true")

    return recording
Exemplo n.º 3
0
def convert_recording(obj):
    """
    :type obj: :class:`sir.schema.modelext.CustomRecording`
    """
    recording = models.recording(id=obj.gid,
                                 title=obj.name,
                                 artist_credit=convert_artist_credit(
                                     obj.artist_credit))  # noqa

    if obj.comment:
        recording.set_disambiguation(obj.comment)

    recording.set_length(obj.length)

    if len(obj.isrcs) > 0:
        recording.set_isrc_list(convert_isrc_list(obj.isrcs))

    if len(obj.tags) > 0:
        recording.set_tag_list(convert_tag_list(obj.tags))

    if len(obj.tracks) > 0:
        recording.set_release_list(
            convert_release_list_for_recordings(obj.tracks))
        for release in recording.release_list.release:
            if release.artist_credit == recording.artist_credit:
                release.set_artist_credit(None)

    if obj.video:
        recording.set_video("true")

    return recording
Exemplo n.º 4
0
def convert_recording_simple(obj):
    """
    :type obj: :class:`sir.schema.modelext.CustomRecording`
    """
    recording = models.recording(id=obj.gid, title=obj.name)
    if obj.video:
        recording.set_video("true")
    return recording
Exemplo n.º 5
0
def convert_recording_simple(obj):
    """
    :type obj: :class:`sir.schema.modelext.CustomRecording`
    """
    recording = models.recording(id=obj.gid, title=obj.name)
    if obj.video:
        recording.set_video("true")
    return recording