else:
        target_folder = dest_dir_name

    logger.debug("Source file {0}".format(os.path.join(options.sdir,
                 track.orig_file)))
    logger.info("Writing file {0}".format(os.path.join(target_folder,
                track.new_file)))
    logger.debug("metadata -> {0:2d} {1} - {2}".format(track.tracknumber,
                track.artist, track.title))
    logger.debug("----------> {0}".format(track.new_file))

    shutil.copyfile(track.orig_file,
                    os.path.join(target_folder, track.new_file))

    # load metadata information
    metadata = MediaFile(os.path.join(target_folder, track.new_file))

    # read already existing (and still wanted) properties
    keepTags = {}
    for name in keep_tags.split(","):
        if getattr(metadata, name):
            keepTags[name] = getattr(metadata, name)

    # remove current metadata
    metadata.delete()

    # set album metadata
    metadata.album = release.album.title

    if split_discs_folder and release.album.disctotal > 1:
        # the fileext should be stored on the album/track as well
예제 #2
0
logging.info("Downloading and storing images")
get_images(release.album.images, release.dest_dir_name, release.album.title)

for track in release.tag_map:
    logger.info("Writing file %s" % os.path.join(release.dest_dir_name,
                track.new_file))
    logger.debug("metadata -> %.2d %s - %s" % (track.position, track.artist,
                 track.title))

    # copy old file into new location
    shutil.copyfile(os.path.join(options.sdir, track.orig_file),
                    os.path.join(release.dest_dir_name, track.new_file))

    # load metadata information
    metadata = MediaFile(os.path.join(
                         release.dest_dir_name, track.new_file))
    # remove current metadata
    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()
예제 #3
0
        target_folder = dest_dir_name

    logger.debug("Source file {0}".format(
        os.path.join(options.sdir, track.orig_file)))
    logger.info("Writing file {0}".format(
        os.path.join(target_folder, track.new_file)))
    logger.debug("metadata -> {0:2d} {1} - {2}".format(track.tracknumber,
                                                       track.artist,
                                                       track.title))
    logger.debug("----------> {0}".format(track.new_file))

    shutil.copyfile(track.orig_file, os.path.join(target_folder,
                                                  track.new_file))

    # load metadata information
    metadata = MediaFile(os.path.join(target_folder, track.new_file))

    # read already existing (and still wanted) properties
    keepTags = {}
    for name in keep_tags.split(","):
        if getattr(metadata, name):
            keepTags[name] = getattr(metadata, name)

    # remove current metadata
    metadata.delete()

    # set album metadata
    metadata.album = release.album.title

    if split_discs_folder and release.album.disctotal > 1:
        # the fileext should be stored on the album/track as well
예제 #4
0
logging.info("Downloading and storing images")
get_images(release.album.images, release.dest_dir_name)

for track in release.tag_map:
    logger.info("Writing file %s" %
                os.path.join(release.dest_dir_name, track.new_file))
    logger.debug("metadata -> %.2d %s - %s" %
                 (track.position, track.artist, track.title))

    # copy old file into new location
    shutil.copyfile(os.path.join(options.sdir, track.orig_file),
                    os.path.join(release.dest_dir_name, track.new_file))

    # load metadata information
    metadata = MediaFile(os.path.join(release.dest_dir_name, track.new_file))
    # remove current metadata
    metadata.delete()
    metadata.title = track.title
    metadata.artist = track.artist
    metadata.album = release.album.title
    metadata.composer = release.album.artist
    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