# music rename

move music files in a directory to an organized folder based on tags.

## how to use

### env

all configuration is done via environment arguments. these will be loaded first from the true environment args, second from `./.env` relative to the working directory, and third from `./music-rename.env` relative to the executable directory.

all environment variables in `.env.example` is required.

### usage standalone

the first argument is the input path of an album.

```sh
./music-rename path/to/album
```

### usage with slskd

[slskd's docs](https://github.com/slskd/slskd/blob/master/docs/config.md#scripts) are out of date as of writing this and do not explain [recent changes made to how scripts are handled](https://github.com/slskd/slskd/issues/1278).

this script relies on the new method of execution, where data is sent via $SLSKD_SCRIPT_DATA.

add the following to your slskd configuration:

```yaml
integration:
  scripts:
    music-rename: # this can be renamed
      on:
        - DownloadDirectoryComplete
      run:
        executable: /path/to/music-rename
```

then configure `/path/to/music-rename.env` based on [#env](#env)
