X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=client%2Fsrc%2Fapp%2Fshared%2Fusers%2Fuser.service.ts;h=7c1ae5799c0758b758b1372aa018cf5036cd7912;hb=64e0f8cf12c804a7a2fa582fd954f686cea9a45b;hp=a7934364686476d95f1a7f834616add83874fcaa;hpb=d3217560a611b94f888ecf3de93b428a7521d4de;p=github%2FChocobozzz%2FPeerTube.git diff --git a/client/src/app/shared/users/user.service.ts b/client/src/app/shared/users/user.service.ts index a79343646..7c1ae5799 100644 --- a/client/src/app/shared/users/user.service.ts +++ b/client/src/app/shared/users/user.service.ts @@ -234,13 +234,15 @@ export class UserService { return this.userCache[userId] } - getUser (userId: number) { - return this.authHttp.get(UserService.BASE_USERS_URL + userId) + getUser (userId: number, withStats = false) { + const params = new HttpParams().append('withStats', withStats + '') + return this.authHttp.get(UserService.BASE_USERS_URL + userId, { params }) .pipe(catchError(err => this.restExtractor.handleError(err))) } getAnonymousUser () { let videoLanguages + try { videoLanguages = JSON.parse(this.localStorageService.getItem(User.KEYS.VIDEO_LANGUAGES)) } catch (err) { @@ -252,11 +254,12 @@ export class UserService { // local storage keys nsfwPolicy: this.localStorageService.getItem(User.KEYS.NSFW_POLICY) as NSFWPolicyType, webTorrentEnabled: this.localStorageService.getItem(User.KEYS.WEBTORRENT_ENABLED) !== 'false', - autoPlayVideo: this.localStorageService.getItem(User.KEYS.AUTO_PLAY_VIDEO) === 'true', - autoPlayNextVideoPlaylist: this.localStorageService.getItem(User.KEYS.AUTO_PLAY_VIDEO_PLAYLIST) === 'true', - theme: this.localStorageService.getItem(User.KEYS.THEME) || 'default', + theme: this.localStorageService.getItem(User.KEYS.THEME) || 'instance-default', videoLanguages, + autoPlayNextVideoPlaylist: this.localStorageService.getItem(User.KEYS.AUTO_PLAY_VIDEO_PLAYLIST) !== 'false', + autoPlayVideo: this.localStorageService.getItem(User.KEYS.AUTO_PLAY_VIDEO) === 'true', + // session storage keys autoPlayNextVideo: this.sessionStorageService.getItem(User.KEYS.SESSION_STORAGE_AUTO_PLAY_NEXT_VIDEO) === 'true' })