Movatterモバイル変換


[0]ホーム

URL:


Skip to content
Search Gists
Sign in Sign up

Instantly share code, notes, and snippets.

@keating
Last activeAugust 29, 2015 14:24
    • Star(0)You must be signed in to star a gist
    • Fork(0)You must be signed in to fork a gist
    Save keating/68d2ab291908ebb9b2be to your computer and use it in GitHub Desktop.
    Change the track titles of EnglighPod mp3 files, so they are in the correct order in iTunes.
    # use gem 'ruby-mp3info'
    require"mp3info"
    dir_root="/Users/keating/Music/EnglishPod 1-50/"
    d=Dir.new(dir_root)
    flags=('A'..'Z').to_a
    d.eachdo |dir_name|
    nextif['.','..','.DS_Store'].include?(dir_name)
    ifFile.directory?(dir_root +dir_name)
    dir=Dir.new(dir_root +dir_name)
    i=0
    dir.eachdo |file_name|
    ifFile.extname(file_name) =='.mp3'
    path="#{dir_root}/#{dir_name}/#{file_name}"
    title="englishpod_#{dir_name}_#{flags[i]}"
    Mp3Info.open(path)do |mp3|
    mp3.tag.title=title
    end
    i +=1
    end
    end
    end
    end
    Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

    [8]ページ先頭

    ©2009-2025 Movatter.jp