Created
May 11, 2022 07:31
-
-
Save daniellwdb/7eaffaa6aed3147d6f41896e7d7af042 to your computer and use it in GitHub Desktop.
beets config
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Beets config | |
# Album art manually saved to music folders from: https://covers.musichoarders.xyz | |
directory: R:/media/music | |
library: ~/iCloudDrive/beets/library.db | |
plugins: | |
## Autotagger Extensions | |
# https://beets.readthedocs.io/en/stable/plugins/discogs.html | |
- discogs | |
# https://beets.readthedocs.io/en/stable/plugins/fromfilename.html | |
- fromfilename | |
## Metadata | |
# https://beets.readthedocs.io/en/stable/plugins/lastgenre.html | |
- lastgenre | |
# https://beets.readthedocs.io/en/stable/plugins/scrub.html | |
- scrub | |
## Path Formats | |
# https://beets.readthedocs.io/en/stable/plugins/bucket.html | |
- bucket | |
# https://beets.readthedocs.io/en/stable/plugins/fetchart.html | |
- fetchart | |
# https://beets.readthedocs.io/en/stable/plugins/inline.html | |
- inline | |
## Interopability | |
# https://beets.readthedocs.io/en/stable/plugins/badfiles.html | |
- badfiles | |
## Miscellaneous | |
# https://beets.readthedocs.io/en/stable/plugins/duplicates.html | |
- duplicates | |
# https://beets.readthedocs.io/en/stable/plugins/info.html | |
- info | |
# https://beets.readthedocs.io/en/stable/plugins/missing.html | |
- missing | |
discogs: | |
source_weight: 0.0 | |
lastgenre: | |
count: 5 | |
bucket: | |
bucket_alpha: | |
- "#-!" | |
- "0-9" | |
- "A" | |
- "B" | |
- "C" | |
- "D" | |
- "E" | |
- "F" | |
- "G" | |
- "H" | |
- "I" | |
- "J" | |
- "K" | |
- "L" | |
- "M" | |
- "N" | |
- "O" | |
- "P" | |
- "Q" | |
- "R" | |
- "S" | |
- "T" | |
- "U" | |
- "V" | |
- "W" | |
- "X" | |
- "Y" | |
- "Z" | |
bucket_alpha_regex: | |
"#-!": ^[^0-9a-zA-Z] | |
bucket_year: [] | |
extrapolate: no | |
fetchart: | |
sources: filesystem | |
original_date: yes | |
per_disc_numbering: yes | |
clutter: ["Thumbs.DB", ".DS_Store", "*.m3u", "*.m3u8", "*.sfv", ".pls"] | |
ui: | |
color: no | |
import: | |
write: yes | |
copy: no | |
move: yes | |
timid: yes | |
match: | |
strong_rec_thresh: 0.10 | |
preferred: | |
countries: ["US", "GB|UK"] | |
media: ["CD", "Digital Media|File", "Vinyl"] | |
original_year: yes | |
paths: | |
default: "%bucket{$albumartist,alpha}/$albumartist/$album ($year)%if{$bettercatalognum, {$bettercatalognum$}} [%if{$iscd,$mediatype - $format,%if{$mediatype,$mediatype - }$format - %if{$bitdepth,$bitdepthmost,$mp3_quality} - $sampleratemost}]/$disc-$track. $title" | |
singleton: "%bucket{$artist,alpha}/$artist/$title ($year)%if{$bettercatalognum, {$bettercatalognum$}} [%if{$iscd,$mediatype - $format,%if{$mediatype,$mediatype - }$format - %if{$bitdepth,$bitdepthmost,$mp3_quality} - $sampleratemost}]/$title" | |
comp: "VA/$album ($year)%if{$bettercatalognum, {$bettercatalognum$}} [%if{$iscd,$mediatype - $format,%if{$mediatype,$mediatype - }$format - %if{$bitdepth,$bitdepthmost,$mp3_quality} - $sampleratemost}]/$disc-$track. $artist - $title" | |
album_fields: | |
iscd: | | |
return "CD" in items[0].media | |
mediatype: | | |
mediaList = { | |
'12" Vinyl': "Vinyl", | |
'7" Vinyl': "Vinyl", | |
"Digital Media": "WEB", | |
} | |
try: | |
return mediaList[items[0].media] | |
except KeyError: | |
return items[0].media | |
bitdepthmost: | | |
bitdepths = dict() | |
for item in items: | |
try: | |
bitdepths[item.bitdepth] += 1 | |
except KeyError: | |
bitdepths[item.bitdepth] = 1 | |
sorted_depths = {k: v for k, v in sorted(bitdepths.items(), key=lambda item: item[1])} | |
return list(sorted_depths)[-1] | |
sampleratemost: | | |
samplerates = dict() | |
for item in items: | |
try: | |
samplerates[item.samplerate] += 1 | |
except KeyError: | |
samplerates[item.samplerate] = 1 | |
sorted_rates = {k: v for k, v in sorted(samplerates.items(), key=lambda item: item[1])} | |
formatted_num = int(list(sorted_rates)[-1]/1000) if int(list(sorted_rates)[-1]/1000) == float(list(sorted_rates)[-1]/1000) else float(list(sorted_rates)[-1]/1000) | |
return str(formatted_num) + "kHz" | |
bettercatalognum: | | |
return items[0].catalognum if items[0].catalognum != "[none]" else "" | |
mp3_quality: | | |
if items[0].format.upper() == "MP3": | |
total_bitrate = 0 | |
for item in items: | |
total_bitrate += item.bitrate | |
average_bitrate = total_bitrate / len(items) / 1000 | |
if average_bitrate == 320: | |
return "320" | |
elif average_bitrate == 192: | |
return "192" | |
elif average_bitrate == 160: | |
return "160" | |
elif average_bitrate == 128: | |
return "128" | |
elif average_bitrate >= 200: | |
return "V0" | |
else: | |
return "TOO LOW FIND NEW SOURCE" | |
else: return items[0].format |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment