These permissions were never meant to be directly edited by staff. They should never have been added to the staff user edit page as it just caused confusion when the settings reset at the daily group change. I've now added these settings to the group directly and allow the settings on the user edit page to override the group settings. I refrained from fixing the can_download permission for now, because so many different things affect it and it will need at 3 separate permissions to control everything it does. Trying to fix it will take much more effort than what can be fixed today. Because of this, I removed the setting from the user edit page to reduce confusion from staff who don't realize it is controlled by the scheduler. Relevant issue: #1820.
| Change | Before | After |
|------------------------|--------|-------|
| Individual to chunking | 355 s | 56 s |
| Permission bool to int | 56 s | 53 s |
| Timestamp comparison | 53 s | 49 s |
With an empty loop, it takes 33 seconds, the remaining 99% of time is used by the `save()` method (even if values are same as before and no queries are done).
Encapsulates the logic for assigning a user to a group and setting permissions within a single if condition; the `else` clause that breaks the loop when a user doesn't meet the conditions for a group is removed, so that promotion is no longer a sequential process. As such, users can can jump straight to Seeder/Archivist ranks.
- github action updated with new ruleset in pint.json
- codebase linted with new ruleset
- contributors can now run `./vendor/bin/pint`
- action workflow will auto correct any lint issues upon commit/opened pull request
- Change simple property init and assign to constructor promotion
- Remove unused variable in catch()
- Change docs types to union types, where possible
Aside from fixing the units, which mixed binary and metric
inadvertently, this commit adds an interface to a third-party library
that handles the conversion much more elegantly and provides flexibility
for future needs of a similar nature.
- removed upper limits
- Seeder and Archivist now go off seedsize instead of seed count which can easily be played by seeding a bunch of small torrents to reap the benifits of these groups.
- using `Model::where('download', '=', 1)` over`Model::where('download', 1)`
- decided is easier for new devs to understand.
- thanks to @werrpy for helping with the regex to mass update.