Skip to content

Implemented per album requests for music#91

Open
tacoroumen wants to merge 5 commits intothomst08:masterfrom
tacoroumen:per-album-request
Open

Implemented per album requests for music#91
tacoroumen wants to merge 5 commits intothomst08:masterfrom
tacoroumen:per-album-request

Conversation

@tacoroumen
Copy link

Implemented per album requests for music
(im not 100% sure i didnt break the "Automatically monitor newly added music" under requests permissions)

Implemented per album requests for music
(im not 100% sure i didnt break the "Automatically monitor newly added music" under requests permissions)
@tacoroumen
Copy link
Author

Found a bug when requesting not previously added artists need to fix this rq

@tacoroumen
Copy link
Author

tacoroumen commented Jan 22, 2026

it seems to be an issue with /api/v1/album/lookup just returning []

@tacoroumen
Copy link
Author

if i soft add artistst it works but seems like a stupid fix (adding artists with nothing monitored then trying to get albums)

@thomst08
Copy link
Owner

Hey tacoroumen,

Very nice!
I will have to go over the code in detail, but a quick glace this looks to cover the main things.
You also got the interaction working through Discord the about what I was expecting, I wanted to have this in when I added Lidarr support, but it added a bit more complexity to just adding Lidarr support in a basic form, so very well done.

I'll have a tinker with the code and see if I can find any issues, but well done :)

@tacoroumen
Copy link
Author

i cant get it to work via api because there is no way to get albums of artists that havent been added to lidarr so i will implement the soft add with just no monitoring just so i can get the albums this seems kinda dumb imo but lidarr doesnt provide it (seems kinda dumb imo) but i guess db space optimization

because if lidarr api limitations it isnt posible to retrieve artist albums without the artist first being added to lidarr
@tacoroumen
Copy link
Author

Alright that should have fixed it

@thomst08
Copy link
Owner

Ok, I've had a bit of a look.

Excellent work.
Hmmmm..... Interesting about Lidarr not allowing that (viewing albums without an artist being added).... .I think when I originally looked at it, I was going to try a two stage request through Lidarr's api, call and make artist but not monitored, then request the media all within the one command, but I don't remember the details when I looked at it..... I can have a look here if you like?

I think this is a great start, but it might be wise tweak a few things before staging it for a release.

  • If we can get the albums to show when requesting a new artist, that would be ideal instead of the add but not monitored approach.
  • Links to the album through the interface when requesting (easy fix)
  • Expose album options to the admin panel for settings, this way, the admin can setup a category to only allow album requests, vs full artist requests, etc.
  • Do we make a second command? like /request music artist:{name} album:{name} along with the interaction you have setup

@thomst08
Copy link
Owner

Hmmmm, I noticed in the new commit, it adds each request item to Lidarr before the user has pressed request, so if you request a generic name, and click down the list, you might add a number of artist without meaning too.....OK, that's an issue.

I'll see if I can come up with a solution for that.

@tacoroumen
Copy link
Author

Hmmmm, I noticed in the new commit, it adds each request item to Lidarr before the user has pressed request, so if you request a generic name, and click down the list, you might add a number of artist without meaning too.....OK, that's an issue.

I'll see if I can come up with a solution for that.

it first lets you select the artist lets say you search ariana grande you then select the ariana grande you want it soft adds that ariana grande (only the one you selected) then it reloads for the next discord with all the albums atleast thats what i thought it did. i checked before pushing that it only does this after selecting the artist and not before when only searching artist name

@tacoroumen
Copy link
Author

i might be wrong tho im not sure

@tacoroumen
Copy link
Author

tacoroumen commented Jan 22, 2026

  • If we can get the albums to show when requesting a new artist, that would be ideal instead of the add but not monitored approach.

on this it might be possible to get all albums from an endpoint like https://musicbrainz.org/ws/2/release-group?artist=a74b1b7f-71a5-4011-9441-d0b5e4122711&fmt=json but im not sure if we want that and even if this is possible to then use this json to get a album in lidarr

  • Links to the album through the interface when requesting (easy fix)

didnt think of this haha

  • Expose album options to the admin panel for settings, this way, the admin can setup a category to only allow album requests, vs full artist requests, etc.

not sure how this would work, i would maybe say like a check box with a bool and then just remove the all albums from the discord drop down seems easiest way to me, so only allow per album or dont limit, i dont think anyone would always want to request all albums from an artist but who am i

  • Do we make a second command? like /request music artist:{name} album:{name} along with the interaction you have setup

we could but then we need to somehow be able to get the albums before adding the artist

@thomst08
Copy link
Owner

  • If we can get the albums to show when requesting a new artist, that would be ideal instead of the add but not monitored approach.

on this it might be possible to get all albums from an endpoint like https://musicbrainz.org/ws/2/release-group?artist=a74b1b7f-71a5-4011-9441-d0b5e4122711&fmt=json but im not sure if we want that and even if this is possible to then use this json to get a album in lidarr

Hmmmm, it's not a bad idea....but I think if Lidarr ever goes away from musicbrainz then this might be an issue. It woul dbe wiser to go through Lidarr's system, there might be forks of Lidarr I am unaware of that use something else.

  • Expose album options to the admin panel for settings, this way, the admin can setup a category to only allow album requests, vs full artist requests, etc.

not sure how this would work, i would maybe say like a check box with a bool and then just remove the all albums from the discord drop down seems easiest way to me, so only allow per album or dont limit, i dont think anyone would always want to request all albums from an artist but who am i

Don't worry about this for the moment, more so something to think on when the command structure is setup. I'm thinking of giving options to the user, I don't mind requesting a whole artist, but I also sometimes hunt for singles, these don't show in albums. So it's just something to consider. I think the more options for the admin, the better.

  • Do we make a second command? like /request music artist:{name} album:{name} along with the interaction you have setup

we could but then we need to somehow be able to get the albums before adding the artist

Yeah....So I am digging into Lidarr's API now and having trouble even getting the search to preform what I want... I think I partly remember there wasn't a clear cut way of doing this at the start, and you had to search for the artist, then the album name, build a list and narrow it down by the two. At least I think that is what I was thinking at the time, but this seems to be different from when I was originally toying with it.....

@tacoroumen
Copy link
Author

Yeah....So I am digging into Lidarr's API now and having trouble even getting the search to preform what I want... I think I partly remember there wasn't a clear cut way of doing this at the start, and you had to search for the artist, then the album name, build a list and narrow it down by the two. At least I think that is what I was thinking at the time, but this seems to be different from when I was originally toying with it.....

what exactly are you trying to search? list of albums of a already added artist? or?

@thomst08
Copy link
Owner

Yeah....So I am digging into Lidarr's API now and having trouble even getting the search to preform what I want... I think I partly remember there wasn't a clear cut way of doing this at the start, and you had to search for the artist, then the album name, build a list and narrow it down by the two. At least I think that is what I was thinking at the time, but this seems to be different from when I was originally toying with it.....

what exactly are you trying to search? list of albums of a already added artist? or?

I was trying to search for an album name through /api/v1/album/lookup, however, it's returning an empty array, using /api/v1/album works, however, it's only what you have locally.

If I remember correctly, using /api/v1/search returns a similar search you would find on MusicBrainz website, and that might be useful, but I am aware there was an issue with Lidarr and MusicBrainz not long ago, so maybe this isn't fully working as it returns only artist now....

Looking over the docs, there is no way to query for an artist albums using their MusicBrainz Id, only their local Id and it will only allow viewing of those albums once the artist is added......

So, I guess that leaves us with a few options....

  1. We wait for Lidarr to implement some support of querying the API so then it fetches albums from MusicBrainz, then we can use that to add to the monitor list. Having a look online, it seems Lidarr has a few issue created around this topic, so I'm sure they don't need another request. But, this might not happen anytime soon.
  2. We could continue down the path you've setup. I would suggest the program adds the artist in an un-monitored state, gets the data and then deletes the artist. But there is a few issues with this.
    • We don't know how long Lidarr will take to do this, if its a slower connection, maybe a good few seconds. This would leave Discord hanging and if it waits too long, the command might get dropped. (My internet was being a tad slow when testing this and it did drop my commands due to the delay)
    • We would need to make sure we deleted the artist after, otherwise we would have a bunch of random artist if the name pulled in a bunch of duplicates, I guess this one on depends on how someone manages their library, but I think it would be wise to clean up our mess if its not needed. This would only be needed when searching new artist, old ones would have the cached data we need.
  3. Maybe setting up a call to MusicBrainz isn't a bad idea....if we can.

These are my thoughts so far.

@thomst08
Copy link
Owner

Side note, I would have to test it, but when you monitor an artist, you can pass in the name of the album to Lidarr in an array, while not ideal, as we have no validation that album is there, you could just accept a album name and push that through with the request to Lidarr, but there is a chance this would fail or not monitor anything.

Something to consider testing if we are out of options.

@tacoroumen
Copy link
Author

@thomst08 something else i now filter only albums so you cant select EP's or Singles we could always rewrite the bot to make it dynamically filter so you do something like /request music artist:{name} type:album/ep/single/all and then you can filter based on that and an all would request everything from that artists

@tacoroumen
Copy link
Author

tacoroumen commented Jan 23, 2026

3. Maybe setting up a call to MusicBrainz isn't a bad idea....if we can.

i noticed that if you do a musicbrainz.org request you can also get the album id this is an identical id as that lidarr uses, also musicbrainz returns a primary-type of type Single, EP or Album we would be able to filter on this directly from within the bot this would give us the option to filter like i said in my previous message it would then just only get Albums or only EP's this could be done by changing the querie so you would add this type=album or if you want albums and ep's type=album|ep but im not sure how many menu's you would want in the bot. i would say you can either select like i want albums and ep's and it downloads all of these or you can say i want albums and then you can select what album

@tacoroumen
Copy link
Author

image

I implemented with musicbrainz.org if the artists doesnt excist yet i will now try and make the album/EP/Single filter for both musicbrainz and lidarr

@tacoroumen
Copy link
Author

tacoroumen commented Jan 23, 2026

image I implemented with musicbrainz.org if the artists doesnt excist yet i will now try and make the album/EP/Single filter for both musicbrainz and lidarr

i have run into an issue with this sometimes musicbrainz knows an album that lidarr doesnt recognize for some reason this just gives the error message for the request @thomst08 do you know why this could be?

Like musicbrainz has albums that lidarr doesnt have for some artists

@thomst08
Copy link
Owner

I will have to have a look, I noticed when you make a request you can specify a name of the album, but I didn't test it or try it out.
Unfortunately its not straightforward to implement. I will have to have a look and explore what you've done and try it out for myself. I'll report back if I find any options.

@tacoroumen
Copy link
Author

Only thing I can't seem to get to work is filtering the EP and Singles by request I could make a button like you request a artist then you select type all,album,ep,single and then you select what you want from each

Also the issue with lidarr and musicbrainz albums not being equal

@thomst08
Copy link
Owner

That's alright, I think it would be best to focus on one part at a time, I think albums are the more important feature, the rest can be added in time.

@tacoroumen
Copy link
Author

tacoroumen commented Jan 23, 2026

https://www.reddit.com/r/Lidarr/s/b6hELR5vPU

This might be related to the mismatch between Lidarr and musicbrainz I was having for albums, seems to be normal behavior I will just implement the official flag filter for the musicbrainz api calls I make so it shouldn't show albums lidarr doesn't I will try this tmr

@tacoroumen
Copy link
Author

https://www.reddit.com/r/Lidarr/s/b6hELR5vPU

This might be related to the mismatch between Lidarr and musicbrainz I was having for albums, seems to be normal behavior I will just implement the official flag filter for the musicbrainz api calls I make so it shouldn't show albums lidarr doesn't I will try this tmr

this was causing the mismatch in secondery type under metadata profile i didnt have Mixtape/Street selected which caused it to not show the album

@tacoroumen
Copy link
Author

so for albums it seems to work now just need to find a clean way to implement the ep and singles
and also ui customization like must be per album, ep or single or can request all at once

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments