commit 1c89aac08ff9b244e9a649555a76de94ca918c7f Author: Jonathan Bernard Date: Mon Sep 5 22:07:53 2016 -0500 Initial implementation. diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..8c341b4 --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +build/ +.gradle/ +*.sw? +.sw? diff --git a/build.gradle b/build.gradle new file mode 100644 index 0000000..6e31679 --- /dev/null +++ b/build.gradle @@ -0,0 +1,23 @@ +repositories { + mavenLocal() + mavenCentral() + maven { url "https://dl.bintray.com/ijabz/maven" } + maven { url "http://mvn.jdb-labs.com/repo" } +} + +apply plugin: 'groovy' +apply plugin: 'application' + +mainClassName = "com.jdbernard.tagrename.TagRename" +version = "1.0.0" + +dependencies { + compile localGroovy() + compile 'ch.qos.logback:logback-classic:1.1.3' + compile 'ch.qos.logback:logback-core:1.1.3' + compile 'org.slf4j:slf4j-api:1.7.14' + compile 'net.jthink:jaudiotagger:2.2.3' + compile 'com.offbytwo:docopt:0.6.0.20150202' + + testCompile 'junit:junit:4.12' +} diff --git a/src/main/groovy/com/jdbernard/tagrename/TagRename.groovy b/src/main/groovy/com/jdbernard/tagrename/TagRename.groovy new file mode 100644 index 0000000..9209e4b --- /dev/null +++ b/src/main/groovy/com/jdbernard/tagrename/TagRename.groovy @@ -0,0 +1,120 @@ +package com.jdbernard.tagrename + +import java.util.ArrayList +import java.util.LinkedList + +import org.docopt.Docopt +import org.jaudiotagger.audio.AudioFile +import org.jaudiotagger.audio.AudioFileIO +import org.jaudiotagger.tag.Tag as JATag +import org.slf4j.Logger +import org.slf4j.LoggerFactory + +import groovy.text.SimpleTemplateEngine + +import static org.jaudiotagger.tag.FieldKey.* + +public class TagRename { + + public static final String VERSION = "1.0.0" + + public static final String DOC = """\ +tag-rename v$VERSION + +Usage: + tag-rename [options] ... + +Options: + -t --template