Update profile API and download views

This commit is contained in:
DariusIII
2025-10-28 01:53:15 +01:00
parent 31523741ab
commit 4f2421b091
6 changed files with 453 additions and 3 deletions
@@ -61,6 +61,15 @@ class ProfileController extends BasePageController
$this->userdata->style = 'Using the admin selected theme.';
}
// Get 24-hour hourly data for downloads and API requests
$downloadsHourly = UserDownload::getHourlyDownloads($userID);
$apiRequestsHourly = UserRequest::getHourlyApiRequests($userID);
// Get role limits
$userRole = $this->userdata->roles->first();
$downloadLimit = $userRole->downloadrequests ?? 0;
$apiLimit = $userRole->apirequests ?? 0;
$this->viewData = array_merge($this->viewData, [
'downloadlist' => UserDownload::getDownloadRequestsForUser($userID),
'apirequests' => UserRequest::getApiRequests($userID),
@@ -72,6 +81,10 @@ class ProfileController extends BasePageController
'privileged' => $privileged,
'isadmin' => $this->userdata->hasRole('Admin'),
'commentslist' => ReleaseComment::getCommentsForUserRange($userID),
'downloadsHourly' => $downloadsHourly,
'apiRequestsHourly' => $apiRequestsHourly,
'downloadLimit' => $downloadLimit,
'apiLimit' => $apiLimit,
'meta_title' => 'View User Profile',
'meta_keywords' => 'view,profile,user,details',
'meta_description' => 'View User Profile for '.$this->userdata->username,