UNIT3D-Community-Edition
UNIT3D-Community-Edition copied to clipboard
[Bug] Global freeleech not taken into account in the API
UNIT3D Version
6.5.0
PHP & Platform
Any
Laravel verion
Any
Have you done this?
- [X] I am willing to share my stack trace and logs
- [ ] I can suggest a fix as a Pull Request
Expectation
When Global freeleech is active and a request /api/torrents/filter
is made with any free[] parameters, every torrents should be returned.
Description
With Global freeleech enabled, when I request the torrents filter API with a free[] = 100 parameter, its only returning the torrents with freeleech 100% enabled, instead of every torrent.
Stack trace & logs
No response
Are you a UNIT3D sponsor?
No, don't give priority to this
Upvote & Fund
- We're using Polar.sh so you can upvote and help fund this issue.
- We receive the funding once the issue is completed & confirmed by you.
- Thank you in advance for helping prioritize & fund our backlog.
Relevant lines here
I'm not sure what your stance on comparisons in your API is, but you could check and see if the array contains the value 100 and if it does then check the config('other.freeleech')
property then use a separate query that would return all the torrents.