~rfm/import-album

Move or copy files into your media library
fe1ee986 — Richard Mavis 4 years ago
Rename the executable.
c2007957 — Richard Mavis 4 years ago
Update repository link in readme.
d2e7468d — Richard Mavis 4 years ago
Update the readme.

refs

master
browse  log 

clone

read-only
https://git.sr.ht/~rfm/import-album
read/write
git@git.sr.ht:~rfm/import-album

You can also use your local clone with git send-email.

#import-album

import-album---move or copy files into your media library.

#Synopsis

import-album [-c] [-i] [-l DIR] FILE [FILE...]

-c, --copy
    Copy files. The default behavior is to move them. For zip
    files, the unzip directory will still be removed.

-i, --interactive
    Confirm values and actions before each copy/move.

-l, --library
    Use the named DIR as the library directory. The default is
    ~/Music.

#Description

import-album knows how to handle plain files or zip files of plain files. Files will be copied into the library directory according to the names present in the source file.

For plain files, it expects the source to be in the format:

{artist name} - {title}.{extension}

And the destination file will be named:

{library}/{artist name}/{title}/01 {title}.{extension}

Zip files will be unzipped into a temporary directory in the same directory as the zip file. The temporary directory will be removed after the operation. The unzipped file names should be in the format:

{artist name} - {album name} - {title}.{extension}

And the destination file will be named:

{library}/{artist name}/{album name}/{title}.{extension}

The zipped file names will presumably contain numbers, if appropriate.

Files in the temporary directory with a name that doesn't conform to the expected format (like "cover.jpg") will retain that name in the destination directory.

#Dependencies

Ruby and a few standard Unix utilities:

  • cut
  • file
  • unzip

#Installation

  1. Clone the repository: https://git.sr.ht/~rfm/import-album.
  2. Move the executable import-album (or make a symlink to it) somewhere in your $PATH.
  3. Ensure the executable is executable (chmod it 744, etc).
  4. There is no step 3.