mrusse / soularr

A Python script that connects Lidarr with Soulseek!
77 stars 7 forks source link

Doesn't search for entire missing list #12

Closed AdamWHY2K closed 4 weeks ago

AdamWHY2K commented 1 month ago

Caps out at 10 missing, looks like 10 is the default value for the pageSize param in the Lidarr API docs

soularr searching for 10 albums: oQ91LJN

> 10 albums wanted in lidarr: c3QLOr6

davemacrae commented 1 month ago

Personally, I would prefer this to be a configurable option. For example, I've currently got ~4000 albums in my wanted list. I'd rather an incremental approach to capturing the albums of X at a time rather than waiting for them all to be found.

mrusse commented 1 month ago

Very good point. Will reopen for now until I implement this.

mrusse commented 1 month ago

Added option: grab_full_wanted_list in the commit below.

https://github.com/mrusse/soularr/commit/e9f2169cdd8aa0e91be1109b3738fd649a1b2d74

AdamWHY2K commented 1 month ago

Personally, I would prefer this to be a configurable option. For example, I've currently got ~4000 albums in my wanted list. I'd rather an incremental approach to capturing the albums of X at a time rather than waiting for them all to be found.

should be noted that if soularr can't find the first (alphabetically sorted) 10 albums it'll never download anything in your wanted list until someone shares one of your first 10 missing albums.

unless lidarr has some kinda random sort for the sort_dir param in get_wanted(), which i don't think it does.

mrusse commented 1 month ago

Thanks for bringing that up, will definitely need to address it. There actually is sort_dir, page_size, sort_key options for get_wanted(). So we can use those. Take a look at the docs for pyarr here: https://docs.totaldebug.uk/pyarr/modules/lidarr.html#pyarr.lidarr.LidarrAPI.get_wanted

mrusse commented 1 month ago

A good solution to this might be to have a config option remove_from_wanted_on_failure and maybe even have a txt file failure_list.txt that lists all the failures and when they happend. This way the script wont try to regrab a failed grab and the user can check the text file to see what albums it missed. Let me know your thoughts.

I think we could do this by using upd_album() with monitored=False

AdamWHY2K commented 1 month ago

hmm, i'm not sure about unmonitoring albums from lidarr because then they won't ever be searched for again, from either slsk or other indexers, at least until the user re-monitors them.

maybe we could store the current page, incrementing by one each run until we reach math.ceil(target_wanted / 10) at which point we set the current page back to 1

mrusse commented 1 month ago

That could work. The remove_wanted_on_failure setting was simple enough so I will still implement it (keep in mind it is a setting that can be disabled). Another thing to note is that the albums will still be in Lidarr under the wanted section you would just have to filter by unmonitored and you could easily re monitor them there (see included pic).

{8FA81C0A-B5E4-4FC1-B621-593708A12138}

I think it is a decent approach since if it comes to this (Soularr and your indexers failing to grab the album) then it likely isnt going to be grabbed on a further run of the script. I will be pushing a commit for this soon just need to test a bit more. Of course feel free to implement your idea too, both approaches can work well together.

AdamWHY2K commented 1 month ago

gotcha, will do :)

mrusse commented 4 weeks ago

Thanks for the contrib! Closing now.