musicfix

music file renamer and tagger
git clone git://git.2f30.org/musicfix
Log | Files | Refs | README | LICENSE

README (3423B)


      1 # Description
      2 
      3 Musicfix is a music file renamer and tagger with consistency concerns.
      4 It has a release-centered logic and gets data from the Discogs.com site.
      5 First configure the target music directory (`mdir` config attribute).
      6 Next browse the site and locate your album.  Change to the album's
      7 directory.  Ensure the files are ordered and provide the release id
      8 to the program.  Enjoy!
      9 
     10 
     11 # Dependencies
     12 
     13   * System packages: taglib
     14   * Ruby gems: stringex taglib-ruby
     15 
     16 
     17 # Usage
     18 
     19     $ musicfix        
     20     Usage: musicfix [fake] relid
     21            musicfix [fake] dump relid [relfile]
     22            musicfix [fake] load [relfile]
     23            musicfix [fake] tags [relfile]
     24 
     25 The common path is to just give the release id:
     26 
     27     $ musicfix 1234
     28 
     29 Alternatively, YAML metadata files can be used (`release.yaml` by default)
     30 in order to dump information from Discogs.com and/or load the information
     31 from file.  This way you can generate a base release file, edit to
     32 your needs, and then use it for tagging and renaming.  The fake prefix
     33 on all commands results in no files to be copied/written and no cover
     34 artwork to be downloaded.  For example:
     35 
     36     $ musicfix dump 1234
     37     $ musicfix fake load
     38     $ musicfix load
     39 
     40 You may also generate a release file using the existing audio file tags
     41 and use that file instead:
     42 
     43     $ musicfix tags
     44     $ musicfix load
     45 
     46 The release metadata is saved together with the music files by default,
     47 and the load command looks for any YAML files in the current directory
     48 (if there is no relfile specified and `release.yaml` does not exist).
     49 This is useful for renaming files again using a new naming scheme.
     50 
     51 
     52 # Configuration
     53 
     54 In the simplest case no configuration is needed!  The music files are
     55 copied to the ~/music directory, which is created if needed.  If you
     56 want to change that, create a `~/.musicfixrc` configuration file
     57 containing:
     58 
     59     mdir: ~/music/fixed
     60 
     61 Furthermore, templates are used for the naming of music files, the
     62 cover artwork image and the release metadata file.  The defaults are:
     63 
     64     track: '"#{mdir}/#{fba}-#{my}-#{fb}-#{fv}/#{fd}#{n}-#{fa}-#{ft}.#{x}"'
     65     image: '"#{mdir}/#{fba}-#{my}-#{fb}-#{fv}/#{zz}-#{fba}-#{fb}_cover.jpg"'
     66     rdata: '"#{mdir}/#{fba}-#{my}-#{fb}-#{fv}/#{zz}-#{fba}-#{fb}_release.yaml"'
     67 
     68 To run a shell command upon completion use the `after` attribute.
     69 For example, to update the MPD database:
     70 
     71     after: '"mpc update #{fba}-#{my}-#{fb}-#{fv}"'
     72 
     73 The variables used in the templates are explained below.
     74 The 'f' prefix means "normalized for filename".
     75 
     76 Use everywhere:
     77 
     78     [f]b: album name
     79     [f]ba: album artist
     80     y: release year
     81     my: master release year
     82     g: genre style
     83     [f]v: release format
     84 
     85 Only for track naming:
     86 
     87     [f]a: track artist
     88     [f]t: track title
     89     [f]d: disc number or side letter for vinyls
     90     n: track number, zero padded
     91     x: file extension in lowercase
     92 
     93 Only for image and rdata naming:
     94 
     95     zz: zeros that match d + n width
     96 
     97 Only for image naming:
     98 
     99     i: the index in the list
    100 
    101 
    102 # Cover artwork support
    103 
    104 From March 2015 and onwards cover artwork images are resources restricted
    105 to authenticated clients.  The easiest way to do this and the one supported
    106 by musicfix is to create a Discogs account and generate a personal access
    107 token from the developers settings.  Add the token in `~/.musicfixrc` like
    108 this:
    109 
    110     token: abcxyz123456
    111 
    112 You'll get no cover artwork without adding your personal access token.