Home

Awesome

AudioTagger

A .NET CLI program that can perform the following actions on audio files:

This is a little labor-of-love project that I work on in my spare time. It relies on the TagLibSharp library for tag reading and writing.

Requirements

Running

Run this app from the AudioTagger.Console folder using dotnet run. Passing no arguments will show the instructions.

Additionally, settings.json should exist in the application directory for some features. A sparsely populated file will be automatically created if it does not already exist when the program is started.

A sample settings file follows:

{
  "artistGenreCsvFilePath": "/Users/me/Documents/audio",
  "resetSavedArtistGenres": true,
  "renaming": {
    "useAlbumDirectories": true,
    "ignoredDirectories": [
      "Directory 1",
      "Directory 2"
    ],
    "patterns": [
      "%ALBUMARTISTS% ≡ %ALBUM% [%YEAR%] = %TRACK% - %ARTISTS% - %TITLE%",
      "%ARTISTS% - %ALBUM% [%YEAR%] - %TRACK% - %TITLE%",
      "%ALBUMARTISTS% ≡ %ARTISTS% - %ALBUM% [%YEAR%] - %TITLE%",
      "%ARTISTS% - %ALBUM% [%YEAR%] - %TITLE%",
      "%ARTISTS% - %ALBUM% - %TRACK% - %TITLE%",
      "%ARTISTS% - %ALBUM% - %TITLE%",
      "%ARTISTS% - %TITLE% [%YEAR%]",
      "%ARTISTS% - %TITLE%",
      "%TITLE%"
    ]
  },
  "duplicates": {
    "pathSearchFor": "/Users/me/Documents/Media/",
    "pathReplaceWith": "",
    "savePlaylistDirectory": "/Users/me/Downloads/NewMusic",
    "titleReplacements": [
      " ",
      " ",
      "-",
      "~",
      "〜",
      "/",
      "/",
      "?",
      "?",
      "!",
      "!",
      "AlbumVersion",
      "AlbumVer",
      "ShortVersion",
      "ShortVer",
      "()",
      "()",
      "•",
      "・",
      ".",
      ":",
      ":"
    ]
  },
  "tagging": {
    "regexPatterns": [
      "(?:(?<albumArtists>.+) ≡ )?(?<album>.+?)(?: ?\\[(?<year>\\d{4})\\])? = (?<trackNo>\\d+) [–-] (?<artists>.+?) [–-] (?<title>.+)(?=\\.(?:m4a|opus))",
      "(?:(?<albumArtists>.+) ≡ )?(?<album>.+?)(?: ?\\[(?<year>\\d{4})\\])? = (?<trackNo>\\d{1,3}) [–-] (?<title>.+)(?=\\.(?:m4a|opus))",
      "(?:(?<albumArtists>.+) ≡ )(?<album>.+?)(?: ?\\[(?<year>\\d{4})\\])? = (?<artists>.+?) [–-] (?<title>.+)(?=\\.(?:m4a|opus))",
      "(?:(?<albumArtists>.+) ≡ )?(?<album>.+?)(?: ?\\[(?<year>\\d{4})\\])? = (?<title>.+)(?=\\.(?:m4a|opus))",    ]
  }
}

Explanation of options: