-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhtagcli.toml
More file actions
135 lines (115 loc) · 4.26 KB
/
Copy pathhtagcli.toml
File metadata and controls
135 lines (115 loc) · 4.26 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
# Default configuration
# Settings under [filename] are used by:
# - the `fix-path` command
# - the `check` command’s `filematches` check (see also [checks.check_files])
[filename]
# Pattern used to generate or validate file paths
# Available placeholders:
# - {artist}: artist tag
# - {albumartist}: album artist tag
# - {album}: album tag
# - {title}: title tag
# - {genre}: genre tag
# - {track}: track number (see `pad_track_numbers`)
# - {year}: year tag
# - {disc}: disc number (see `pad_disc_numbers`)
# Additional syntax:
# - {albumartist|artist}: use albumartist tag; if missing, fall back to artist
# - {prefix-?disc?-suffix}: if the disc tag is present, include it with the
# given prefix and suffix; otherwise, omit everything between the braces
filename_matches = "{albumartist|artist}/{album}/{Disc-?disc?}/{track}-{title}"
# Characters to sanitize in file paths and how to handle them
# Each entry defines:
# - `char`: the character to match
# - `action`: one of:
# - "remove": delete the character
# - "replace:<new_char>": replace it with `<new_char>`
unwanted = [
{ char = " ", action = "replace:_" },
{ char = "/", action = "remove" },
{ char = "?", action = "remove" },
{ char = ":", action = "remove" },
{ char = "\"", action = "remove" },
{ char = "*", action = "remove" },
{ char = ">", action = "remove" },
]
# How to pad track numbers in the {track} placeholder
# Accepted values:
# - "ignore": ignore padding when checking; no padding when fixing
# - "1": no padding
# - "2": pad to 2 digits (01, 02, ..., 10, 11, ...)
# - "3", "4", ...: pad to N digits
pad_track_numbers = "2"
# Same for disc numbers
pad_disc_numbers = "ignore"
# htagcli will truncate any placeholder value exceeding this length. Useful for
# tracks with very long titles.
placeholder_max_length = 30
# Settings for the `fix-path` command
[fix_paths]
# Directory where music files are moved when fixing their paths
base_dir = "/absolute/path/to/your/Music"
# Used to move cover files along the audio files. `checks.disc_cover.filenames`
# must be enabled for this to work.
# Any file that matches `checks.disc_cover.filenames` in the same directory as
# the current audio file will be moved along with it.
move_cover = true
# Configuration for validation checks
[checks]
# Ensure required tags are present
[checks.track_tags]
enable = true
tags = ["title", "artist", "album", "genre", "year", "track"]
# Ensure the genre tag matches one of the allowed values
[checks.track_genre]
enable = true
among = [
"Pop/Rock",
"Jazz",
"Country",
"Blues",
"Latin",
"International",
"Classical",
"Hip-Hop",
]
# Verify that file paths match the expected naming pattern and formatting
# options
[checks.track_filename]
enable = true
# Verify that each disc directory contains a cover image
[checks.disc_cover]
enable = true
filenames = ["cover.jpg", "cover.png", "cover.gif"]
# optional size constraints in pixels, not taken into account if left
# unspecified.
# Warning: this makes the check significantly slower
min_size = { width = 300, height = 300 }
max_size = { width = 1000, height = 1000 }
# Verify that all tracks from the same disc reside in a single directory
# Note: htagcli groups files by disc while scanning input paths recursively.
[checks.disc_same_dir]
enable = true
# Verify that disc-level tags are consistent across all tracks of a disc. No
# need to check for album, artist, or albumartist tags here as it is already
# enforced by htagcli when grouping tracks into discs.
[checks.disc_tags] enable = true tags = ["year", "genre"]
# Verify that track numbers in each disc are sequential starting from 1
[checks.disc_tracks_sequential]
enable = true
# Verify that album-level tags are consistent across all discs of an album.
# Same as above, no need to check for album, artist, or albumartist tags here.
[checks.album_tags]
enable = true
tags = ["year", "genre"]
# Verify that disc numbers within an album are sequential starting from 1
[checks.album_discs_sequential]
enable = true
# Verify that all tracks from an artist have the same genre
[checks.artist_same_genre]
enable = true
# In some cases, an artist may legitimately span multiple genres. One can list
# them here to have the check pass for those artists.
except = [
{ artist = "Some Artist", genres = ["Pop/Rock", "Original Soundtracks"] }
]