Lidarr: Singles Management
Fighting one promotional single at a time.
I hate promotional singles. They shouldn't exist. I understand the point of them (drumming up hype for an album release) but as someone who uses Lidarr to keep track of music, dealing with singles that are already on albums is beyond frustrating.
So frustrating in fact, I wrote a quick tool to manage them. It also let me get used to maintaining a Docker Image for ease of use.
The Quick & Dirty
If you don't care about the development of the tool and just want to learn about it, here you go.
Simply put, we use the Lidarr API to look at every album and check if a single appears on an album. If so, we either unmonitor, delete, or notify the user depending on what settings they have set.
If you want to give it a shot yourself, the project link along with the docker command is here.
Learning how to accomplish your goals
While the code is quite simple (100~ lines in fact) I learned a lot while working on it.
The Lidarr API is self explanatory, with JSON fields to read data from. I'm used to that, however this was my first time writing code to use environment variables, and docker images.
Environment variables aren't too different than just reading from a
config.json file which I've done many times in Node. So that wasn't too much of a learning curve.
However, making a Docker container I've never done before.
While the Dockerfile is quite simple, it's still something I've only used while working on this project.
Publishing the Docker Container is another thing, I use GitHub Actions to do so, and learning how to do this was a bit of trial and error. It's quite simple when you boil it down.
docker buildwith a tag
- Login to registry
docker pushthe built image
For some reason, it took me a while to understand that, but once I did I was off to the races.
Complete with GitHub Action Secrets, and Actions as a whole, all I have to do is change the code, push to GitHub, and everything else is taken care of. It's awesome getting CI/CD done because you can sit back and just work on the code.