-
Notifications
You must be signed in to change notification settings - Fork 31
tagging
Note: Stripped refers to removal of all non alphanumeric (exception of single quote character) and lowercasing.
The tagger prepares a folder for upload and runs the necessary quality checks
required by RED rules on the files. It will run a search on all metadata
providers to find releases matching the current release, and present a list of
releases for the user to choose from. The goal of this is to create a more
complete dictionary of metadata for the tagger, so it can apply better tags to
all of the files. The tagger begins with an initial set of metadata gathered
from the file tags, but due to the lacking nature of most tag sets it's far
from sufficient for all the track information. Also because of the lack of
standards for some tags (e.g. label and catalognumber), the script will look
for related tags that are frequently used and re-assign them to the tags fields
used by this script. This currently maps YEAR
to DATE
, RECORDLABEL
,
ORGANIZATION
, and PUBLISHER
to LABEL
, and LABELNO
, CATALOG #
, and
CATNO
to CATALOGNUMBER
. Multiple releases may be selected, which will be
combined into a single aggregate metadata dictionary of information.
Selecting releases can be done either by ID or URL. In fact, URLs which were never scraped by salmon can be pasted into the metadata selection prompt, and will be used to tag the releases. A mixture of IDs and URLs will work.
The combination process is fairly straightforward, with values being supplemented into metadata dictionary if they did not previously exist. Track-specific metadata changes can only occur if the stripped track title of the metadata source matches the stripped track title of the base metadata, which is built from the file tags. Therefore, if your track titles are improperly tagged, your tracks may be lacking additional metadata. The major bonus of the retagging procedure is the addition of artists from various sources, which are stripped of special characters and lowercased to be compared to one another. As many artists from various sources are added to this release. The "guest" artist importance takes precedence over the "main" importance if the same artist is assigned both on the same track. After this, the user is able to edit the dictionary in their default editor if they choose to do so. Once metadata is gathered and confirmed, the script moves on to the tagging process.
Since the original tags are utilized as the metadata base and for comparison,
sometimes they may cause issues if inaccurate or garbage. Metadata can be
overwritten with an --overwrite
/-ow
flag, and in that event the scraped
metadata will be the only metadata used. This option is also available in the
folder uploader, but not the tidal URL/search uploaders.
After gathering the metadata, the script will print its current metadata
to the terminal. The next prompt will allow you to edit any part of the metadata.
Once finished, respond with n
(nothing) to continue with the rest of the tagging
process.
The artists editing window will come up as a text file, with a list of artists in
an Artist Name (Role)
format. You can substitute any role into the parentheses
or the artist name. Roles should be lowercase. This only affects the artists for the
entire release; these artists determine the albumartist tag, the artist in the folder
name, and what goes on the group page on RED. The following roles are allowed: main
,
guest
, remixer
, composer
, conductor
, djcompiler
, and producer
.
Due to the crappy nature of artist metadata gathering, a special artist-editing
method is prompted for prior to the full metadata-editing prompt. This prompt
allows the user to directly edit a list of artists present in the release,
signal some for deletion, and others for renaming. A text file is opened with
a list of artists at the top of the page, and then an instructional line. Below
that, artist aliases in the following syntax: <artist> --> <alias>
can be
entered, separated by newlines. The artist will have its name transformed into
the alias across every track and the release's artist list, if present. In order
to delete an artist from each track, leave the alias blank or just whitespace.
As an example, let's say you have Eli & Fur
as an artist on the track, but
the script has split them into two different artists: Eli
and Fur
. In this
page, you can add two alias lines. Eli --> Eli & Fur
and Fur -->
.
Let's take another scenario. The artist puff & beats
is tagged for every track,
but they are actually two different artists. In your artist editing file,
you should create two lines. One being puff & beats --> puff
, and the other
being puff & beats --> beats
.
Tags are built from the metadata dictionary and split into two groups. Album-specific tags, or tags that remain consistent throughout the entire release (Album, Album Artist, Genre, UPC) are applied to every track in the release, while track-specific tags are applied individually to each track. Tags with multiple values are combined into a single string with a semicolon delimiter, since support for multiple vorbis tags of the same field is lacking in a lot of media players. Proposed tag changes are printed, and the user has the option of applying them or not. The tags of a random track are then printed, and the option to open the files in a tag editor (by default, puddletag for Linux) is given to the user.
Folder and file names are also covered in the tagging process. A folder name
and file names are constructed from the template in config.py
. Proposed
changes are printed to stdout, and renaming/moving occurs after user confirmation.
Non-audio files (e.g. log/cue) are moved along with audio files if they were in a
subdirectory with the audio files. Path length, zero-length folders, and file
extensions are also validated after the renaming process.
The tagging process is not very cut-and-dry. In more complicated releases, it will fail. For example in compilations, Various Artists may be the "artist name" from a source. If that is the case, it must be removed in the artist-aliasing step of the tagging process.
$ ./run.py tag -s web G-Eazy\ -\ No\ Limit\ \(2017\) Processing /home/lights/Tidal/G-Eazy - No Limit (2017) Checking metadata... Previous metadata: > TRACK COUNT : 1 > ARTISTS: >>> Cardi B [guest] >>> G-Eazy [main] >>> A$AP Rocky [guest] > TITLE : No Limit > GROUP YEAR : 2017 > YEAR : 2017 > EDITION TITLE : None > LABEL : RCA Records > CATNO : None > GENRES : > RELEASE TYPE : None > COMMENT : None Results for iTunes: > 01 [E] G-Eazy - No Limit (feat. A$AP Rocky & Cardi B) - Single {Tracks: 1} 2017 RCA Records | https://itunes.apple.com/us/album/1278388839 > 02 [C] G-Eazy - No Limit (feat. A$AP Rocky & Cardi B) - Single {Tracks: 1} 2017 RCA Records | https://itunes.apple.com/us/album/1278381375 > 03 [E] G-Eazy - No Limit (feat. A$AP Rocky, French Montana, Juicy J & Belly) [Remix] - Single {Tracks: 1} 2017 RCA Records | https://itunes.apple.com/us/album/1324158642 Results for Discogs: > 04 G-Eazy - The Beautiful & Damned {Album, LP, Vinyl} 2018 Vinyl RCA 88985-46750-1 | https://www.discogs.com/release/12010755 > 05 G-Eazy - The Beautiful & Damned {CD, Album} 2017 CD RCA 88985-46750-2 | https://www.discogs.com/release/11270141 > 06 G-Eazy - The Beautiful & Damned {CD, Album} 2017 CD RCA 88985-49668-2 | https://www.discogs.com/release/11318506 Results for Beatport: > 07 Various - No Limit Large Music | https://pro.beatport.com/release/a/234514 > 08 Master P - The G Mixtape No Limit Forever | https://pro.beatport.com/release/a/1838956 > 09 Various - Crossfire Clinique Recordings | https://pro.beatport.com/release/a/1071539 Results for Tidal: > 10 [DE] [E] G-Eazy - No Limit {Tracks: 1} 2017 RCA Records | https://listen.tidal.com/album/78229033 > 11 [DE] [E] G-Eazy - No Limit REMIX {Tracks: 1} 2017 RCA Records | https://listen.tidal.com/album/82315348 Results for Deezer: > 12 G-Eazy - No Limit REMIX {Tracks: 1} | https://www.deezer.com/album/53293952 > 13 G-Eazy - No Limit {Tracks: 1} | https://www.deezer.com/album/47347952 > 14 G-Eazy - No Limit {Tracks: 1} | https://www.deezer.com/album/47347962 No results found from Bandcamp. No results found from MusicBrainz. No results found from Junodownload. Which metadata results would you like to use? Other options: paste URLs, [m]anual, [a]bort: 1 10 13 Pending metadata: > TRACK COUNT : 1 > ARTISTS: >>> A$AP Rocky [guest] >>> Cardi B [guest] >>> G-Eazy [main] > TITLE : No Limit > GROUP YEAR : 2017 > YEAR : 2017 > EDITION TITLE : None > LABEL : RCA Records > CATNO : None > GENRES : Rap; Hip Hop > RELEASE TYPE : Single > COMMENT : None Are there any metadata fields you would like to edit? [a]rtists, artist a[l]iases, [t]itle, [g]enres, [r]elease type, [y]ears, [e]dition info, [c]omment, trac[k]s, [n]othing: n Proposed tag changes: Album tags (applied to all): > album ••• No Limit > genre ••• None >>> Hip Hop; Rap > date ••• 2017 >>> 2017 > label ••• RCA Records > albumartist ••• G-Eazy > upc ••• 886446711249 Would you like to auto-tag the files with the updated metadata? [Y/n]: Retagged files. Checking tags... > artist: G-Eazy (feat. A$AP Rocky & Cardi B) > title: No Limit > isrc: USRC11702117 > tracknumber: 1 > discnumber: 1 > tracktotal: 1 > disctotal: 1 > replaygain_track_gain: -10.5 > replaygain_track_peak: 0.977752 > album: No Limit > genre: Hip Hop; Rap > date: 2017 > label: RCA Records > albumartist: G-Eazy > upc: 886446711249 Are the above tags acceptable? ([n] to open in tag editor) [Y/n]: Renaming folder... Old folder name : G-Eazy - No Limit (2017) New pending folder name: G-Eazy - No Limit (2017) [WEB FLAC] {RCA Records} Would you like to replace the original folder name? [Y/n]: Is the new folder name acceptable? [Y/n]: Renamed folder to G-Eazy - No Limit (2017) [WEB FLAC] {RCA Records}. No file renaming is recommended. Checking folder structure... No paths exceed 180 characters in length. No zero length folders were found. File extensions have been validated. Processed /home/lights/Tidal/G-Eazy - No Limit (2017) [WEB FLAC] {RCA Records}