tamland / python-tidal

Python API for TIDAL music streaming service
GNU Lesser General Public License v3.0
402 stars 109 forks source link

What effect does `item_limit` has? #219

Closed exislow closed 8 months ago

exislow commented 8 months ago

For different media types different limits applies. Thus, pagination is sometimes necessary to retrieve all items. But then there is item_limit in `Config, which is only used here: https://github.com/tamland/python-tidal/blob/85271ada2f6f92916ee024d6df4a8ddaff45f278/tidalapi/request.py#L68

What effect does it have?

tehkillerbee commented 8 months ago

This is just a session configuration parameter that can be set at init, similar to quality.

I think the idea is to set the limit once, at startup and then use the same limit for all media types.

exislow commented 8 months ago

But there are media types, which have a max limit of 100.

tehkillerbee commented 8 months ago

I cannot say for sure what the thought was behind this, as I did not implement it. But I think the assumption was that a common config parameter could be used for all media types. But in practice that won't work, as some media types has smaller max limits.

In any case, all media types use hard-coded limits right now so this config parameter can most likely be ignored.

tehkillerbee commented 8 months ago

Closing this, as I think the question has been answered.

morguldir commented 8 months ago

Back in the day when we mainly had tracks, some client tokens only allowed you to use 100 as a limit for tracks IIRC, so you needed to be able to specify the item limit in the same spot as the client token.

That specific part isn't as relevant anymore, but you can still use it if you only wanna fetch lets say 10 items at once and use pagination instead