musicfix

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

README (3609B)


      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 [tracks]
     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 More sophisticated track selection can be performed by providing
     30 a tracks selector command line argument of the form:
     31 
     32     "1--3,5,8"
     33     "A2--A4,B3"
     34     "1-8--1-9,1-10--1-11"
     35 
     36 Alternatively, YAML metadata files can be used (`release.yaml` by default)
     37 in order to dump information from Discogs.com and/or load the information
     38 from file.  This way you can generate a base release file, edit to
     39 your needs, and then use it for tagging and renaming.  The fake prefix
     40 on all commands results in no files to be copied/written and no cover
     41 artwork to be downloaded.  For example:
     42 
     43     $ musicfix dump 1234
     44     $ musicfix fake load
     45     $ musicfix load
     46 
     47 You may also generate a release file using the existing audio file tags
     48 and use that file instead:
     49 
     50     $ musicfix tags
     51     $ musicfix load
     52 
     53 The release metadata is saved together with the music files by default,
     54 and the load command looks for any YAML files in the current directory
     55 (if there is no relfile specified and `release.yaml` does not exist).
     56 This is useful for renaming files again using a new naming scheme.
     57 
     58 
     59 # Configuration
     60 
     61 In the simplest case no configuration is needed!  The music files are
     62 copied to the ~/music directory, which is created if needed.  If you
     63 want to change that, create a `~/.musicfixrc` configuration file
     64 containing:
     65 
     66     mdir: ~/music/fixed
     67 
     68 Furthermore, templates are used for the naming of music files, the
     69 cover artwork image and the release metadata file.  The defaults are:
     70 
     71     track: '"#{mdir}/#{fba}-#{my}-#{fb}-#{fv}/#{fd}#{n}-#{fa}-#{ft}.#{x}"'
     72     image: '"#{mdir}/#{fba}-#{my}-#{fb}-#{fv}/#{zz}-#{fba}-#{fb}_cover.jpg"'
     73     rdata: '"#{mdir}/#{fba}-#{my}-#{fb}-#{fv}/#{zz}-#{fba}-#{fb}_release.yaml"'
     74 
     75 To run a shell command upon completion use the `after` attribute.
     76 For example, to update the MPD database:
     77 
     78     after: '"mpc update #{fba}-#{my}-#{fb}-#{fv}"'
     79 
     80 The variables used in the templates are explained below.
     81 The 'f' prefix means "normalized for filename".
     82 
     83 Use everywhere:
     84 
     85     [f]b: album name
     86     [f]ba: album artist
     87     y: release year
     88     my: master release year
     89     g: genre style
     90     [f]v: release format
     91 
     92 Only for track naming:
     93 
     94     [f]a: track artist
     95     [f]t: track title
     96     [f]d: disc number or side letter for vinyls
     97     n: track number, zero padded
     98     x: file extension in lowercase
     99 
    100 Only for image and rdata naming:
    101 
    102     zz: zeros that match d + n width
    103 
    104 Only for image naming:
    105 
    106     i: the index in the list
    107 
    108 
    109 # Cover artwork support
    110 
    111 From March 2015 and onwards cover artwork images are resources restricted
    112 to authenticated clients.  The easiest way to do this and the one supported
    113 by musicfix is to create a Discogs account and generate a personal access
    114 token from the developers settings.  Add the token in `~/.musicfixrc` like
    115 this:
    116 
    117     token: abcxyz123456
    118 
    119 You'll get no cover artwork without adding your personal access token.