diff --git a/modules/core/client/controllers/header.client.controller.js b/modules/core/client/controllers/header.client.controller.js index c087afc7..bc0f7cc7 100644 --- a/modules/core/client/controllers/header.client.controller.js +++ b/modules/core/client/controllers/header.client.controller.js @@ -6,10 +6,10 @@ .controller('HeaderController', HeaderController); HeaderController.$inject = ['$scope', '$state', '$stateParams', '$translate', 'Authentication', 'menuService', 'MeanTorrentConfig', 'localStorageService', - 'ScoreLevelService', 'InvitationsService', '$interval', 'MessagesService', 'TorrentsService', 'UsersService']; + 'ScoreLevelService', 'InvitationsService', '$interval', 'MessagesService', 'TorrentsService', 'UsersService', 'DebugConsoleService']; function HeaderController($scope, $state, $stateParams, $translate, Authentication, menuService, MeanTorrentConfig, localStorageService, ScoreLevelService, - InvitationsService, $interval, MessagesService, TorrentsService, UsersService) { + InvitationsService, $interval, MessagesService, TorrentsService, UsersService, mtDebug) { var vm = this; vm.user = Authentication.user; vm.language = MeanTorrentConfig.meanTorrentConfig.language; @@ -136,6 +136,7 @@ vm.getSiteInfo = function () { TorrentsService.siteInfo(function (data) { vm.siteInfo = data; + mtDebug.info(data); }); }; } diff --git a/modules/torrents/server/controllers/torrents.server.controller.js b/modules/torrents/server/controllers/torrents.server.controller.js index e5cc0506..43a514a6 100644 --- a/modules/torrents/server/controllers/torrents.server.controller.js +++ b/modules/torrents/server/controllers/torrents.server.controller.js @@ -1296,13 +1296,13 @@ exports.siteInfo = function (req, res) { res.json({ totalUsers: results[0], totalTorrents: results[1], - totalTorrentsSize: results[2][0].size, - totalSeeders: results[2][0].seeders, - totalLeechers: results[2][0].leechers, - totalUploaded: results[3][0].uploaded, - totalDownloaded: results[3][0].downloaded, + totalTorrentsSize: results[2][0] ? results[2][0].size : 0, + totalSeeders: results[2][0] ? results[2][0].seeders : 0, + totalLeechers: results[2][0] ? results[2][0].leechers : 0, + totalUploaded: results[3][0] ? results[3][0].uploaded : 0, + totalDownloaded: results[3][0] ? results[3][0].downloaded : 0, totalForumTopics: results[4], - totalForumReplies: results[5][0].replies, + totalForumReplies: results[5][0] ? results[5][0].replies : 0, totalVipUsers: results[6] }); }