This commit is contained in:
2023-02-24 11:05:25 -05:00
parent 7ad0fd9c7d
commit 14c99f9845

View File

@@ -1,154 +1,154 @@
{ config, pkgs, lib, ... }: { config, pkgs, lib, ... }:
{ {
options.mymods.beets.enable = lib.mkEnableOption "Beets music manager"; options.mymods.beets.enable = lib.mkEnableOption "Beets music manager";
config = lib.mkIf config.mymods.beets.enable { config = lib.mkIf config.mymods.beets.enable {
programs.beets = { home-manager.users."sstent".programs.beets = {
enable = true; enable = true;
settings = { settings = {
album_fields = { album_fields = {
artist_grouping = '' artist_grouping = ''
albumartist_dev = ["devin townsend", "devin townsend project","punky brüster","strapping young lad"] albumartist_dev = ["devin townsend", "devin townsend project","punky brüster","strapping young lad"]
DevinFolder = "_Devin Townsend Projects" DevinFolder = "_Devin Townsend Projects"
if albumartist.lower() in albumartist_dev: if albumartist.lower() in albumartist_dev:
return DevinFolder return DevinFolder
albumartist_les = ["primus", "les claypool","les claypool and the holy mackerel","les claypools duo de twang","oysterhead","colonel claypools bucket of bernie brains","the les claypool frog brigade","the claypool lennon delirium"] albumartist_les = ["primus", "les claypool","les claypool and the holy mackerel","les claypools duo de twang","oysterhead","colonel claypools bucket of bernie brains","the les claypool frog brigade","the claypool lennon delirium"]
LesFolder = "_Les Claypool Projects" LesFolder = "_Les Claypool Projects"
if albumartist.lower() in albumartist_les: if albumartist.lower() in albumartist_les:
return LesFolder return LesFolder
''; '';
atype = '' atype = ''
atypes = ['EP', 'Single','Live'] atypes = ['EP', 'Single','Live']
for atype in atypes: for atype in atypes:
if atype.lower() == albumtype.lower(): if atype.lower() == albumtype.lower():
return f' [{atype}]' return f' [{atype}]'
''; '';
first_artist = "albumartist.split(', ',1)[0:1][0]"; first_artist = "albumartist.split(', ',1)[0:1][0]";
}; };
albumtypes = { albumtypes = {
bracket = "[]"; bracket = "[]";
ignore_va = "compilation"; ignore_va = "compilation";
types = [ types = [
{ ep = "EP"; } { ep = "EP"; }
{ single = "Single"; } { single = "Single"; }
{ soundtrack = "OST"; } { soundtrack = "OST"; }
{ live = "Live"; } { live = "Live"; }
{ compilation = "Anthology"; } { compilation = "Anthology"; }
{ remix = "Remix"; } { remix = "Remix"; }
]; ];
}; };
aunique = { aunique = {
bracket = "[]"; bracket = "[]";
disambiguators = "media"; disambiguators = "media";
keys = "albumartist album"; keys = "albumartist album";
}; };
copyartifacts = { extensions = ".cue .log .jpg .jpeg .png .txt"; }; copyartifacts = { extensions = ".cue .log .jpg .jpeg .png .txt"; };
directory = "/mnt/q/CleanMusic/"; directory = "/mnt/q/CleanMusic/";
embedart = { auto = true; }; embedart = { auto = true; };
extrafiles = { extrafiles = {
paths = { paths = {
artworkdir = "$albumpath/Artwork"; artworkdir = "$albumpath/Artwork";
"ext:cue" = "$albumpath/$disc_folder/Data/"; "ext:cue" = "$albumpath/$disc_folder/Data/";
"ext:jpg" = "$albumpath/$disc_folder/"; "ext:jpg" = "$albumpath/$disc_folder/";
"ext:log" = "$albumpath/$disc_folder/Data/"; "ext:log" = "$albumpath/$disc_folder/Data/";
}; };
patterns = { patterns = {
all = "*.*"; all = "*.*";
artworkdir = [ "[sS]cans/" "[aA]rtwork/" "[aA]rt/" "[cC]over/" ]; artworkdir = [ "[sS]cans/" "[aA]rtwork/" "[aA]rt/" "[cC]over/" ];
}; };
}; };
fetchart = { fetchart = {
auto = true; auto = true;
sources = "filesystem coverart itunes amazon albumart fanarttv"; sources = "filesystem coverart itunes amazon albumart fanarttv";
}; };
import = { import = {
autotag = true; autotag = true;
bell = false; bell = false;
copy = true; copy = true;
languages = "en"; languages = "en";
log = "~/beet/beet.log"; log = "~/beet/beet.log";
move = false; move = false;
write = true; write = true;
}; };
item_fields = { item_fields = {
isMultidisc = "1 if disctotal > 1 else 0"; isMultidisc = "1 if disctotal > 1 else 0";
myBitDepth = "('' if bitdepth != 24 else '[24bit - '+ media + ']')"; myBitDepth = "('' if bitdepth != 24 else '[24bit - '+ media + ']')";
myDisc = "('' if disctotal <= 1 else str(disc) + ' - ')"; myDisc = "('' if disctotal <= 1 else str(disc) + ' - ')";
mySongartist = mySongartist =
"artist + ' - ' if artist != albumartist and artist != '' else ''"; "artist + ' - ' if artist != albumartist and artist != '' else ''";
}; };
library = "~/musiclibrary.db"; library = "~/musiclibrary.db";
match = { match = {
max_rec = { max_rec = {
album = "strong"; album = "strong";
album_id = "strong"; album_id = "strong";
albumdisambig = "strong"; albumdisambig = "strong";
artist = "strong"; artist = "strong";
catalognum = "strong"; catalognum = "strong";
country = "strong"; country = "strong";
label = "strong"; label = "strong";
media = "strong"; media = "strong";
mediums = "strong"; mediums = "strong";
missing_tracks = "medium"; missing_tracks = "medium";
source = "strong"; source = "strong";
track_artist = "strong"; track_artist = "strong";
track_id = "strong"; track_id = "strong";
track_index = "strong"; track_index = "strong";
track_length = "strong"; track_length = "strong";
track_title = "strong"; track_title = "strong";
tracks = "strong"; tracks = "strong";
unmatched_tracks = "medium"; unmatched_tracks = "medium";
year = "strong"; year = "strong";
}; };
strong_rec_thresh = 5.0e-2; strong_rec_thresh = 5.0e-2;
}; };
missing = { missing = {
format_album = "$albumartist: ($year) $album $albumtype $atype"; format_album = "$albumartist: ($year) $album $albumtype $atype";
format_item = "$albumartist - $album [$albumtype]$atype: $track/$tracktotal $title"; format_item =
}; "$albumartist - $album [$albumtype]$atype: $track/$tracktotal $title";
musicbrainz = { };
pass = "7ANCLPczDNFn6Sf65vdZ"; musicbrainz = {
user = "shapechecker"; pass = "7ANCLPczDNFn6Sf65vdZ";
}; user = "shapechecker";
original_date = true; };
paths = { original_date = true;
"albumtype:soundtrack" = "Soundtracks/$albumartist - $album%aunique{} ($year)/$myDisc$track - $artist - $title"; paths = {
comp = "Compilations/$albumartist/($year) $album%aunique{}/$myDisc$track - $artist - $title"; "albumtype:soundtrack" =
default = "%if{$artist_grouping,$artist_grouping/}$first_artist/$year - $album $atype%aunique{media}[%upper{$format}$bitdepth]%if{$media,[$media]}/%if{$isMultidisc,$disc - }$track - $mySongartist$title"; "Soundtracks/$albumartist - $album%aunique{} ($year)/$myDisc$track - $artist - $title";
}; comp =
per_disc_numbering = true; "Compilations/$albumartist/($year) $album%aunique{}/$myDisc$track - $artist - $title";
plugins = [ default =
"albumtypes" "%if{$artist_grouping,$artist_grouping/}$first_artist/$year - $album $atype%aunique{media}[%upper{$format}$bitdepth]%if{$media,[$media]}/%if{$isMultidisc,$disc - }$track - $mySongartist$title";
"duplicates" };
"fetchart" per_disc_numbering = true;
"rewrite" plugins = [
"missing" "albumtypes"
"chroma" "duplicates"
"embedart" "fetchart"
"inline" "rewrite"
"discogs" "missing"
"mbcollection" "chroma"
]; "embedart"
rewrite = { "inline"
"artist Björk & Tríó Guðmundar Ingólfssonar" = "Björk"; "discogs"
"artist Brant Bjork and The Low Desert Punk Band" = "Brant Bjork"; "mbcollection"
"artist King Gizzard & The Lizard Wizard with Mild High Club" = "King Gizzard & The Lizard Wizard"; ];
"artist Kyuss _ Queens of the Stone Age" = "Kyuss"; rewrite = {
"artist Professor Elemental & Tom Caruana" = "Professor Elemental"; "artist Björk & Tríó Guðmundar Ingólfssonar" = "Björk";
"artist Resin Dogs Feat Spikey Tee" = "Resin Dogs"; "artist Brant Bjork and The Low Desert Punk Band" = "Brant Bjork";
"artist Sepultura _ Exodus" = "Sepultura"; "artist King Gizzard & The Lizard Wizard with Mild High Club" =
"artist The Knife in collaboration with Mount Sims and Planningtorock" = "The Knife"; "King Gizzard & The Lizard Wizard";
"artist Unida _ Dozer" = "Unida"; "artist Kyuss _ Queens of the Stone Age" = "Kyuss";
}; "artist Professor Elemental & Tom Caruana" = "Professor Elemental";
}; "artist Resin Dogs Feat Spikey Tee" = "Resin Dogs";
"artist Sepultura _ Exodus" = "Sepultura";
"artist The Knife in collaboration with Mount Sims and Planningtorock" =
"The Knife";
"artist Unida _ Dozer" = "Unida";
};
};
}; };
}; };
} }