Ejemplo n.º 1
0
    # encoder
    if encoder_tag is not None:
        metadata.encoder = encoder_tag

#    if track.discsubtotal:
#        metadata.discsubtotal = track.discsubtotal

    # set track metadata
    metadata.title = track.title
    metadata.artist = track.artist
    metadata.artist_sort = track.sortartist
    metadata.track = track.tracknumber

    # the following value will be wrong, if the disc has a name or is a multi
    # disc release --> fix it
    metadata.tracktotal = release.album.tracktotal_on_disc(track.discnumber)


    # it does not make sense to store this in the "common" configuration, but only in the 
    # id.txt. we use a special naming convention --> most probably we should reuse the 
    # configuration parser for this one as well, no?
    for name, value in release_tags.items():
        if name.startswith("tag:"):
            name = name.split(":")
            name = name[1]
            setattr(metadata, name, value)

    first_image_name = release.first_image_name
# this should be done in a cleaner way to avoid multiple images in different
# folders (use the dest_dir again....)
    if embed_coverart and os.path.exists(os.path.join(dest_dir_name,
Ejemplo n.º 2
0
    metadata.delete()
    metadata.title = track.title.lower()
    metadata.artist = track.artist.lower()
    metadata.album = release.album.title.lower()
    metadata.composer = release.album.artist.lower()
    metadata.albumartist = release.album.artist.lower()
    metadata.label = release.album.label.lower()
    metadata.year = release.album.year
    # adding two are there is no standard. discogstagger pre v1
    # used (TXXX desc="Catalog #")
    # mediafile uses TXXX desc="CATALOGNUMBER"
    metadata.catalognum = release.album.catno
    metadata.catalognumber = release.album.catno
    metadata.genre = release.album.genre.lower()
    metadata.track = track.position
    metadata.tracktotal = len(release.tag_map)

    if embed_coverart and os.path.exists(os.path.join(release.dest_dir_name,
                                         "%s.jpg" % release.album.title)):
        imgdata = open(os.path.join(release.dest_dir_name,
                       "%s.jpg" % release.album.title)).read()
        imgtype = imghdr.what(None, imgdata)

        if imgtype in ("jpeg", "png"):
            logger.info("Embedding album art.")
            metadata.art = imgdata

    metadata.save()

#
# start supplementary actions
Ejemplo n.º 3
0
    # encoder
    if encoder_tag is not None:
        metadata.encoder = encoder_tag

#    if track.discsubtotal:
#        metadata.discsubtotal = track.discsubtotal

# set track metadata
    metadata.title = track.title
    metadata.artist = track.artist
    metadata.artist_sort = track.sortartist
    metadata.track = track.tracknumber

    # the following value will be wrong, if the disc has a name or is a multi
    # disc release --> fix it
    metadata.tracktotal = release.album.tracktotal_on_disc(track.discnumber)

    # it does not make sense to store this in the "common" configuration, but only in the
    # id.txt. we use a special naming convention --> most probably we should reuse the
    # configuration parser for this one as well, no?
    for name, value in release_tags.items():
        if name.startswith("tag:"):
            name = name.split(":")
            name = name[1]
            setattr(metadata, name, value)

    first_image_name = release.first_image_name
    # this should be done in a cleaner way to avoid multiple images in different
    # folders (use the dest_dir again....)
    if embed_coverart and os.path.exists(
            os.path.join(dest_dir_name, first_image_name)):
Ejemplo n.º 4
0
    metadata.albumartist = release.album.artist
    metadata.label = release.album.label
    metadata.year = release.album.year
    # adding two are there is no standard. discogstagger pre v1
    # used (TXXX desc="Catalog #")
    # mediafile uses TXXX desc="CATALOGNUMBER"
    metadata.catalognum = release.album.catno
    metadata.catalognumber = release.album.catno

    genre = release.album.genre
    if use_style:
        genre = release.album.styles[0]

    metadata.genre = genre
    metadata.track = track.position
    metadata.tracktotal = len(release.tag_map)

    if embed_coverart and os.path.exists(
            os.path.join(release.dest_dir_name, "00-image-01.jpg")):
        imgdata = open(os.path.join(release.dest_dir_name,
                                    "00-image-01.jpg")).read()
        imgtype = imghdr.what(None, imgdata)

        if imgtype in ("jpeg", "png"):
            logger.info("Embedding album art.")
            metadata.art = imgdata

    metadata.save()

#
# start supplementary actions