Like you I try to support artists by purchasing physical media or releases on Bandcamp. Outside of that I get my music on Soulseek, through torrents, Usenet, and occasionally XDCC. I don’t need lossless files and even if I download FLACs I transcode them to 320kbps MP3 before they go on my iPod anyway. The harder it becomes to acquire music legally the less bad I feel about downloading with abandon.

53
submitted 1 month ago* (last edited 1 month ago) by sillyhatsonly@lemmy.blahaj.zone to c/selfhosted@lemmy.world

This is my guide for generating playlists for your local music library using ListenBrainz and the troi recommendation engine. troi is still being developed and the official documentation isn't great so I figured documenting my process might help others who are interested. I've tried this both with local folders on my Debian server and with my Navidrome library from my Macbook so I will do my best to explain both.

There are a few requirements

  1. Your music must be tagged with MusicBrainz. I use beets for this but you can also use the MusicBrainz desktop client.
  2. You need a ListenBrainz account. Data can be imported from Last.fm or Libre.fm if you have it.

Install troi

Install troi and nmslib with pip

pip install troi
pip install nmslib-metabrainz

If you're on a managed python install use pipx and add the virtual environment to your PATH (don't forget to reload)

pipx install troi
pipx inject troi nmslib-metabrainz
export PATH="$PATH":"$HOME/.local/bin"
source ~/.zshrc

Configure troi

Create a folder for your troi configuration files. I used ~/.config/troi. Create a file config.py in your configuration folder using the example format below. Edit DATABASE_FILE and MUSIC_DIRECTORIES to match your setup.

If you're using a Subsonic library (like Navidrome) you can fill in SUBSONIC_HOST with your instance url, SUBSONIC_USER and SUBSONIC_PASSWORD with your login and SUBSONIC_PORT with 443 (this is the only port that I could get to work with my docker setup)

# Where to find the database file
# If path is passed with -d flag, this list is ignored.
DATABASE_FILE = "/users/sillyhatsonly/.config/troi/troi-db.db"

# To connect to a Subsonic API
SUBSONIC_HOST = "https://music.myserver.dev"  # include http:// or https://
SUBSONIC_USER = "admin"
SUBSONIC_PASSWORD = "thisisnotmypassword"
SUBSONIC_PORT = 443

# List of music directories to scan by default
# If paths are passed to scan command, this list is ignored.
# Invalid directories are skipped.
MUSIC_DIRECTORIES = [
    'My/Music/Directory 1',
    'My/Music/Directory 2',
]

Create your music database

Now create the database, scan the local directories specified in config.py and pull ListenBrainz tag/popularity metadata for all files. If you're using a Subsonic library run troi db subsonic instead of troi db scan

# create database
troi db create
# scan music directories
troi db scan
# pull music metadata
troi db metadata

Generate playlists

Generate playlists for your local library using ListenBrainz Radio Local. Specify a mode which sets how closely the resulting playlist will meet the prompt (easy/medium/hard from closest to furthest) and an entity reference either artist or tag. More details in the docs: LB Prompt Radio Reference

# tracks by Thou and similar artists
troi lb-radio easy 'artist:(thou)' -m <playlist-name>.m3u

# tracks tagged 'jazz' and tracks tagged 'hip-hop'
troi lb-radio medium 'tag:(jazz)::or tag:(hip-hop)'

# tracks tagged both 'indie rock' and 'experimental'
troi lb-radio medium 'tag:(indie rock, experimental)'

Another option is to generate weekly recommendations playlists for your ListenBrainz account

# -m flag saves to the specified m3u playlist
troi weekly-jams <username> -m <playlist-name>.m3u

# -u flag uploads the playlist via Subsonic API
troi weekly-jams <username> -u

Automate weekly playlists

You can automate weekly playlists with a script. I wrote a script that scans my music directory, removes missing files, generates a playlist, and saves it locally as an m3u

#!/bin/sh

# scan music directory and pull metadata using the database in our troi config folder
troi db scan 'My/Music/Directory 1' -q -d '/users/sillyhatsonly/.config/troi/troi-db.db'
troi db metadata 'My/Music/Directory 1' -q -d '/users/sillyhatsonly/.config/troi/troi-db.db'
# clean up the database and remove any missing files
troi db cleanup --remove -q -d '/users/sillyhatsonly/.config/troi/troi-db.db'
# generate weekly playlist and save locally to m3u
troi weekly-jams <username> -d '/users/sillyhatsonly/.config/troi/troi-db.db' -y -q -m /users/sillyhatsonly/music/playlists/weekly-$(date +%Y%m%d).m3u

Then set it up to run weekly as a cron job.


That's all I've done so far. Hopefully this makes sense. I welcome comments or questions. If anyone else has been using troi with their local music libraries I'd love to hear about your experience. Playlist generation was the one feature I really missed when I stopped using streaming platforms so I'm excited about this tool!

[-] sillyhatsonly@lemmy.blahaj.zone 15 points 6 months ago

This looks sick you did an amazing job!

[-] sillyhatsonly@lemmy.blahaj.zone 8 points 7 months ago

I’m a MacBook user and I’ve been very happy with AlDente. It took some reading to understand all the features but I really believe it’s made a difference in the health of my battery.

[-] sillyhatsonly@lemmy.blahaj.zone 6 points 9 months ago

Not a playlist per se but Datafruits.fm is a cooperative online radio station

[-] sillyhatsonly@lemmy.blahaj.zone 57 points 9 months ago* (last edited 9 months ago)

A mask mandate was recently reinstated for New York City's public hospitals due to an increase in flu/COVID/RSV infections.

The Centers for Disease Control and Prevention recently warned that respiratory illnesses are on the rise across the country. Just before Christmas, national COVID-19 hospitalizations jumped 17% in one week.

"I think that's a major reason why we're seeing this rise in not only cases, but also hospitalizations. Because we've just had Thanksgiving, Christmas, New Year's, so a lot of people are gathering from all over the country," Roy told NY1.

[-] sillyhatsonly@lemmy.blahaj.zone 18 points 10 months ago

I quit my awful office job in September after 10 years to focus on recovery from acute health issues. I’ll be freelancing in 2024 and even though I know I made the right decision I’m secretly terrified that I will fail. Just gotta keep going!

[-] sillyhatsonly@lemmy.blahaj.zone 10 points 11 months ago

If you're printing PLA then 80°C bed temp is way too hot and probably contributing to warping, lower the temp to 60°C or so. The filament roll should have suggested temperatures labeled on it somewhere.

[-] sillyhatsonly@lemmy.blahaj.zone 6 points 11 months ago

I've moved away from free personal Fusion360 to OnShape and it suits my needs just fine. The free tier makes all my models public but I don't mind, and it runs much more smoothly in my browser than Fusion ever did on my desktop.

I can’t remember the last time I saw a Raspberry Pi for $40, the demand still has prices sky-high

21

I'm trying to reign in my iOS camera roll and I figured it would be easier on desktop. Turns out the Photos app suuuuuuucks. All I want is to categorize photos by tag or folder and then remove them from the main view. Albums are nice in theory but they're an extra click/tap away from the home screen and don't hide photos from the camera roll. Is there a better way to do this?

I could watch The Emperor's New Groove all day, every day and never get tired.

124

cross-posted from: https://lemmy.blahaj.zone/post/1312795

[Image description: A screenshot of the lemmy.blahaj.zone front page with a custom userstyle applied. The userstyle features a dark gray background with medium gray text and brightly-colored accents of purple, pink, orange, and cyan. The right sidebar cards are a light shade of gray with lighter gray text, pink buttons, and orange links]

A few weeks ago I decided to try my hand at bringing my favorite theme to Lemmy and this userscript was born. It's still in the early stages so there are some wrinkles to iron out, but I just pushed a big update with better contrast, style fixes, and streamlined code.

I've received several requests to turn it into a native Lemmy theme but have no idea how to do that. If anyone has any tips on theming, interest in collaborating, or a Lemmy instance where I could test a native theme, hit me up! You can find all the code here on Codeberg.

18
submitted 1 year ago* (last edited 3 months ago) by sillyhatsonly@lemmy.blahaj.zone to c/plugins@sh.itjust.works

cross-posted from: https://lemmy.blahaj.zone/post/1312795

[Image description: A screenshot of the lemmy.blahaj.zone front page with a custom userstyle applied. The userstyle features a dark gray background with medium gray text and brightly-colored accents of purple, pink, orange, and cyan. The right sidebar cards are a light shade of gray with lighter gray text, pink buttons, and orange links]

A few weeks ago I decided to try my hand at bringing my favorite theme to Lemmy and this userscript was born. It's still in the early stages so there are some wrinkles to iron out, but I just pushed a big update with better contrast, style fixes, and streamlined code.

I've received several requests to turn it into a native Lemmy theme but have no idea how to do that. If anyone has any tips on theming, interest in collaborating, or a Lemmy instance where I could test a native theme, hit me up! You can find all the code here on Codeberg.

27

[Image description: A screenshot of the lemmy.blahaj.zone front page with a custom userstyle applied. The userstyle features a dark gray background with medium gray text and brightly-colored accents of purple, pink, orange, and cyan. The right sidebar cards are a light shade of gray with lighter gray text, pink buttons, and orange links]

A few weeks ago I decided to try my hand at bringing my favorite theme to Lemmy and this userscript was born. It's still in the early stages so there are some wrinkles to iron out, but I just pushed a big update with better contrast, style fixes, and streamlined code.

I've received several requests to turn it into a native Lemmy theme but have no idea how to do that. If anyone has any tips on theming, interest in collaborating, or a Lemmy instance where I could test a native theme, hit me up! You can find all the code here on Codeberg.

13

When adding a new task in iOS there’s a toolbar at the bottom with icons to include date, location, flag, or an image. Is there a way to add a priority tag without having to tap the Details icon to go into a separate menu? I like prioritizing my reminders but I hate having to take that extra step.

Thank you! I'm glad you like it. I didn't anticipate interest in a native theme but I'll certainly look into it and let you know when I cobble something together 😁

166

Decided to try my hand at bringing my favorite theme to Lemmy. It's very rough right now but I figured I would share with the community. You can install it in Stylus here to test. I welcome all feedback and suggestions!

view more: next ›

sillyhatsonly

joined 1 year ago