Commit Graph

103 Commits

Author SHA1 Message Date
Roardom
9ab8ba18e5 refactor: reduce usage of numeric strings 2024-08-26 10:14:52 +00:00
Roardom
a0299daa16 refactor: use eloquent relations directly 2024-08-18 03:26:41 +00:00
Roardom
f5195a000c update: lazy load stats index 2024-08-11 05:29:57 +00:00
Roardom
8f65d5095e update: improve client stats
Group client versions by their respective client, count number of peers per client, and link to peer search for staff.
2024-08-10 07:11:32 +00:00
Roardom
d00475778b update: normalize user settings
Use a 1-1 relation. Cache it indefinitely to reduce queries for every http request. This will make it much easier to add additional user settings for various site features without sacrificing clean code or performance.
2024-05-26 10:42:00 +00:00
Roardom
b86475a732 add: strict types to all files 2024-05-23 13:58:29 +00:00
HDVinnie
08abf6d8ca add: request #3692
- closes #3692
2024-05-07 20:21:27 -04:00
HDVinnie
8fafbefb53 update: StatsController.php
- show all groups but staff
2024-03-27 06:48:11 -04:00
HDVinnie
18d5ff83db update: StatsController.php 2024-03-27 06:35:52 -04:00
HDVinnie
b9e0094458 chore: pint 2024-03-25 22:42:08 -04:00
Jay Sizzla
160bb26c8b Add perks to the groups requirements view 2024-03-21 16:27:41 +01:00
Jay Sizzla
1a5169f4cf Add groups requirements table 2024-03-17 11:42:03 +01:00
Roardom
b274347313 refactor: use whereRelation when possible
All changes were tested for performance regressions. None of the included changes were affected. However, the code that uses `whereIn('category_id', Category::select('id')->where('movie_meta', '=', 1)` saw a ~10% performance loss so should not be changed.
2024-03-03 15:56:02 +00:00
Roardom
44b1063887 add: upload snatches to extra stats 2024-02-01 06:34:06 +00:00
HDVinnie
ea0018a862 PHP Style Change (Laravel Pint CI) 2024-01-16 18:05:08 +00:00
HDVinnie
b0d2157434 Merge pull request #3163 from Roardom/simplify-client-stats-controller
(Refactor) Simplify client stats controller
2023-10-08 13:25:19 -04:00
HDVinnie
954586253b Merge pull request #3162 from Roardom/extra-stats-eager-loading
(Update) Use eager loading in group stats
2023-10-08 13:24:52 -04:00
Roardom
99b45bd7d4 refactor: simplify client stats controller 2023-10-07 07:14:39 +00:00
Roardom
8036a8d5e8 update: use eager loading in group stats 2023-10-07 07:11:58 +00:00
Roardom
c9628dc5f0 fix: stats query for disabled/pruned/banned users 2023-10-07 07:07:48 +00:00
Roardom
2ca7adbbe5 fix: various larastan controller issues 2023-08-25 09:13:18 +00:00
Roardom
1bc31fda9d fix: only use active peers for stats and bon 2023-08-03 07:28:16 +00:00
Roardom
c554e29abe update: keep peers that stopped announcing for longer
Now that we upsert history records without first selecting them, we can't rely on storing a peer's last uploaded/downloaded values in the history record to determine the user's uploaded/downloaded delta between the last announce. If a user has internet issues for a brief period of time but their client continues working, then their change of upload/download between the two announces needs to be kept track of. This is usually kept track of in the peer record, but if the peer is deleted after 2 hours of not announcing, then their last uploaded/downloaded data is deleted with it. We previously stored this data in the history table to handle such cases but this became erroneous if the user had multiple peers on a torrent. This new solution keeps the peers in the database for 2 days before concluding that the peer isn't coming back and deletes the peer permanently. After which point, a new peer will be created and an assumption is made that they uploaded/downloaded 0 data within their downtime.
2023-07-29 05:12:35 +00:00
Roardom
b6b4313bdc update: various database performance improvements
Use eager loading where necessary and add a few indexes. The existing index on private_messages for sender_id and read was probably a typo and intended for receiver_id. The first 3 tables indexes are added to are used for queries ran on every page load: namely the new pm, new notification and warnings indicator in the navbar. Additionally, another index on genre_movie proved useful for finding all the genres when given a movie id. Perhaps, another index for finding all movies within a genre would be good as well, but will leave that for a future optimization if deemed necessary.
2023-07-17 00:21:08 +00:00
Roardom
d2e36c368e refactor: reduce temporary variables passed to views 2023-06-19 23:25:40 +00:00
Roardom
1fa4a3e506 refactor: swap sorting in laravel to ordering in the database 2023-06-19 23:18:40 +00:00
HDVinnie
f4ebee885c update: lint 2023-02-03 22:23:00 -05:00
HDVinnie
472c820f99 update: UNIT3D linting
- 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
2023-02-02 08:02:34 -05:00
HDVinnie
a29b34ab0b add: theme stats 2022-11-27 22:52:32 -05:00
HDVinnie
2ca429c4ce Revert "PSR12 Linting"
This reverts commit 7e65e1d589.
2022-09-11 19:51:58 -04:00
HDVinnie
7e65e1d589 PSR12 Linting 2022-09-11 23:50:41 +00:00
HDVinnie
906a39a6ee Merge branch '6.x.x' into seedtime-stats 2022-08-27 08:58:19 -04:00
Roardom
542a314700 add: seedtime stats 2022-08-27 01:44:19 -05:00
Roardom
3b6ab71ed7 add: seedsize stats 2022-08-27 01:24:40 -05:00
HDVinnie
80eece3174 fix: #2298
- closes #2298
2022-07-06 16:08:18 -04:00
Shift
be2d37ed6e Use Illuminate\Support\Carbon 2022-05-31 22:05:34 +00:00
HDVinnie
b49028a1c4 update: stats controller 2022-03-30 09:24:26 -04:00
innocente205
46225226ee (Update) StatsController
Double counting some seeds
2022-03-28 20:56:49 +07:00
HDVinnie
dd19889ee6 Merge branch '6.x.x' into Code-Style 2022-01-10 17:03:50 -05:00
HDVinnie
5e01a26c88 optimize: whereIn and whereNotIn queries 2022-01-10 16:25:26 -05:00
HDVinnie
a2cdb5f5ff update: type hints 2022-01-08 14:37:50 -05:00
HDVinnie
77ec35bea5 chore: apply the laravel code style linter 2022-01-08 00:03:12 -05:00
HDVinnie
97394c062f chore: adopt type hints 2022-01-07 23:35:33 -05:00
alkl58
62fb1afc5b Apply fixes from StyleCI 2021-12-14 21:25:13 +01:00
alkl58
f700027513 (Add) Torrent Client Stats 2021-12-14 21:08:17 +01:00
clandestine8
a737482e79 Apply fixes from StyleCI
[ci skip] [skip ci]
2021-09-06 23:26:02 +00:00
HDVinnie
321847e067 Apply fixes from StyleCI
[ci skip] [skip ci]
2021-05-16 02:41:53 +00:00
HDVinnie
3407075214 refactor: better php8 usage
- Change simple property init and assign to constructor promotion
- Remove unused variable in catch()
- Change docs types to union types, where possible
2021-05-15 22:41:28 -04:00
HDVinnie
aed5db2066 refactor: stats controller 2020-12-30 12:19:50 -05:00
HDVinnie
0733269867 update: phpdoc blocks 2020-07-22 16:57:13 -04:00