Skip to content

Commit 211d972

Browse files
committed
update readme
1 parent ce435d1 commit 211d972

File tree

1 file changed

+22
-2
lines changed

1 file changed

+22
-2
lines changed

README.md

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ To describe the general workflow:
6666
- **Cover fetching** or upgrades from the [Cover Art Archive](https://coverartarchive.org/).
6767
- Care taken to ensure **no orphan** folders are left in the library when moves or copies occur.
6868
- Validation to ensure your library is **always consistent** with no duplicates or unrecognised paths.
69+
- Proper **multi-disc** release handling with correct disc numbers and subtitles.
6970
- Safe **concurrent** processing with tree-style filesystem locking.
7071
- Addons for fetching lyrics, calculating [ReplayGain](https://wiki.hydrogenaud.io/index.php?title=ReplayGain_2.0_specification), or any user-defined subprocess.
7172
- Rescanning the library and processing it for new changes in MusicBrainz (`wrtag sync`).
@@ -516,15 +517,26 @@ On Windows, you can use drive letters and backslashes:
516517
path-format C:\User\John\Music\{{ <some artist format> }}\({{ <some release format> }}\{{ <track format> }}
517518
```
518519
520+
> [!NOTE]
521+
> Path formats are validated to ensure that all tracks from a release (including multi-disc releases) are placed in the same directory. If your format uses `.Media` fields in the directory portion (not just the filename), validation will fail.
522+
519523
## Available template data
520524
521525
The template has access to the following data:
522526
523527
- `.Release` - The full MusicBrainz release object (see [`type Release struct {`](https://github.com/sentriz/wrtag/blob/master/musicbrainz/musicbrainz.go))
524528
- `.ReleaseDisambiguation` - A string for release and release group disambiguation
525529
- `.IsCompilation` - Boolean indicating if this is a compilation album
526-
- `.Media` - The current media being processed (see [`type Media struct {`](https://github.com/sentriz/wrtag/blob/master/musicbrainz/musicbrainz.go))
530+
- `.Media` - The current media/disc being processed (see [`type Media struct {`](https://github.com/sentriz/wrtag/blob/master/musicbrainz/musicbrainz.go))
531+
- `.Media.Position` - Disc number (1, 2, 3...)
532+
- `.Media.TrackCount` - Total tracks on this disc
533+
- `.Media.Title` - Disc subtitle (if any)
534+
- `.Media.Format` - Media format (e.g., "CD", "Vinyl")
527535
- `.Track` - The current track being processed (see [`type Track struct {`](https://github.com/sentriz/wrtag/blob/master/musicbrainz/musicbrainz.go))
536+
- `.Track.Position` - Track number on the disc (1, 2, 3...)
537+
- `.Track.Number` - Track number as string (e.g., "1", "A1" for vinyl)
538+
- `.Track.Title` - Track title
539+
- `.Track.Artists` - Track artists
528540
- `.Ext` - The file extension for the current track, including the dot (e.g., ".flac")
529541
530542
## Helper functions
@@ -579,12 +591,18 @@ Including multi-album artist support, release group year, release group and rele
579591
/music/{{ artists .Release.Artists | sort | join "; " | safepath }}/({{ .Release.ReleaseGroup.FirstReleaseDate.Year }}) {{ .Release.Title | safepath }}/{{ pad0 2 .Track.Position }} {{ if .IsCompilation }}{{ artistsString .Track.Artists | safepath }} - {{ end }}{{ .Track.Title | safepath }}{{ .Ext }}
580592
```
581593
582-
### With disc and track numbers
594+
### With track position and total tracks
583595
584596
```
585597
/music/{{ artists .Release.Artists | sort | join "; " | safepath }}/({{ .Release.ReleaseGroup.FirstReleaseDate.Year }}) {{ .Release.Title | safepath }}/{{ pad0 2 .Track.Position }}.{{ .Media.TrackCount | pad0 2 }} {{ .Track.Title | safepath }}{{ .Ext }}
586598
```
587599
600+
### With disc number for multi-disc releases
601+
602+
```
603+
/music/{{ artists .Release.Artists | sort | join "; " | safepath }}/({{ .Release.ReleaseGroup.FirstReleaseDate.Year }}) {{ .Release.Title | safepath }}/{{ .Media.Position }}-{{ pad0 2 .Track.Position }} {{ .Track.Title | safepath }}{{ .Ext }}
604+
```
605+
588606
# Addons
589607
590608
Addons can be used to fetch/compute additional metadata after the MusicBrainz match has been applied and the files have been tagged.
@@ -682,6 +700,8 @@ Example track is [America Is Waiting](https://musicbrainz.org/release/3b28412d-8
682700
| `GENRE` | Primary genre | `ambient` |
683701
| `GENRES` | Genre list as multi-valued tag | `ambient`, `art rock`, `electronic`, `experimental` |
684702
| `TRACKNUMBER` | Track number | `1` |
703+
| `DISCNUMBER` | Disc number | `1` |
704+
| `DISCSUBTITLE` | Disc subtitle (media title) | `Bonus Disc` |
685705
| `ISRC` | International Standard Recording Code | `GBAAA0500384` |
686706
| `REMIXER` | Concatenated remixers on the recording | `Artist One, Artist Two` |
687707
| `REMIXERS` | multi-valued remixers on the recording | `Artist One`, `Artist Two` |

0 commit comments

Comments
 (0)