Giter Site home page Giter Site logo

agilecreativity / clj-audiotagger Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 1.0 21 KB

Clojure command-line library designed to make it easy to manipulate/cleanup bad mp3 tag with UTF-8 support

License: Eclipse Public License 1.0

Clojure 97.17% Shell 2.83%
clojure jaudiotagger claudio java-interop command-line-tool

clj-audiotagger's Introduction

clj-audiotagger

Clojars Project Dependencies Status

Clojure library designed to make it easy to manipulate/cleanup bad mp3 tag with UTF-8 support.

Design with simplicity in mind so out of the box it can do the following:

  • Set the file name as title of the mp3 track
  • Set the track index to current position in the list e.g. track/track-total based on the current position
  • Set common tags shared by all the files (e.g. same artist, album, genre, etc)

Built on top of the two useful library

Basic Usage

Will be provided the easy way to run this later for now please see below.

Development

Available via clojars.org/clj-audiotagger

  • Leiningen
[clj-audiotagger "0.2.0"]
  • Gradle
compile "clj-audiotagger:clj-audiotagger:0.2.0"
  • Maven
<dependency>
  <groupId>clj-audiotagger</groupId>
  <artifactId>clj-audiotagger</artifactId>
  <version>0.2.0</version>
</dependency>

Pre-requisite

  • Java SDK
  • Clojure
  • Leiningen

Installation

  • Clone the repository
# clone the repository
mkdir -p ~/projects

# clone the repository
git clone [email protected]:agilecreativity/clj-audiotagger.git ~/projects

# Generate the standalone binary (to be installed to `~/bin`)
mkdir -p ~/bin

# Now build the standalone executable using [lein-bin]
lein bin

You should get output like the following:

$lein bin
Created /home/bchoomnuan/codes/others/clj-audiotagger/target/clj-audiotagger-0.2.0.jar
Created /home/bchoomnuan/codes/others/clj-audiotagger/target/clj-audiotagger-0.2.0-standalone.jar
Creating standalone executable: /home/bchoomnuan/codes/others/clj-audiotagger/target/clj-audiotagger
Copying binary to #object[java.io.File 0x3cc79c02 /home/bchoomnuan/bin]

Note that the executable is called clj-audiotagger and is automatically copied to ~/bin/clj-audiotagger

Basic Usage

Assume that the ~/bin is in your $PATH

# Run the command without any options will print default usage

~/bin/clj-audiotagger`

# Or if ~/bin is your executable path you could just type
clj-audiotagger

Which should produce something like:

Update mp3 id3 tag using simple rules.

Usage: clj_audiotagger [options]
  -b, --base-dir DIR             .  The staring directory
  -f, --file-name-as-title          Use file name as title
  -t, --position-as-track-order     Use position as track order
  -u, --set-shared-tags             Update shared tags
  -c, --cover COVER_FILE            The shared cover file that will be updated to
  -h, --help

Options:

--base-dir DIR starting directory
--cover COVER_FILE the shared cover file if any
--filename-as-title
--position-as-track-order
--set-shared-tags tags
  title   TITLE
  album   ALBUM
  artist  ARTIST
  genre   GENRE
  year    YEAR
  comment COMMENT

Please refer to the manual page for more information.

Sample Usage

  • To rename all the mp3 files to the filename try
clj-audiotagger --base-dir ~/media/mp3s --file-name-as-title
  • To update the play index try
# long version
clj-audiotagger --base-dir ~/media/mp3s --position-as-track-order

# Or short version
clj-audiotagger -b ~/media/mp3s -t
  • To update the common attributes of a given list of files

e.g. Good use-case if have the media sharing the same type of attribute (artist, album, year)

# Using short version of the command
clj-audiotagger -b ~/media/mp3s -u album "Metallica Greatest Hits" artist "Metallica" comment "My fav band"

for list of the attribute please see claudio for attribute you can set.

The common values are:

title   TITLE
album   ALBUM
artist  ARTIST
genre   GENRE
year    YEAR
comment COMMENT
  • To update the cover image for all files in a given directory (both jpg and png are supported)
# If you have the png file
clj-audiotagger -b ~/media/mp3s \
                -u album "Metallica Greatest Hits" artist "Metallica" comment "My fav band" \
                -c music/metallica-cover.png

# If you have the jpg file
clj-audiotagger -b ~/media/mp3s \
                -u album "Continuum" artist "John Mayer" \
                -c music/john-mayer.jpg

Roadmaps/Todos

  • Add documentation on how to run it with lein-bin
  • Add the ability to update of cover image for a file

Useful Links

Some links I found useful while developing this library

License

Copyright © 2016 Burin Choomnuan

Distributed under the Eclipse Public License either version 1.0 or (at your option) any later version.

clj-audiotagger's People

Contributors

agilecreativity avatar

Watchers

 avatar  avatar

Forkers

plumpmath

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.