]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - client/src/app/core/users/user-local-storage.service.ts
Add ability for plugins to add metadata
[github/Chocobozzz/PeerTube.git] / client / src / app / core / users / user-local-storage.service.ts
index f1588bdd2c9dcb3423789df3010af0ae78e8f67c..1e629249a692e3b54d589732d274fffd318d15ea 100644 (file)
@@ -59,7 +59,10 @@ export class UserLocalStorageService {
       id: parseInt(this.localStorageService.getItem(UserLocalStorageKeys.ID), 10),
       username: this.localStorageService.getItem(UserLocalStorageKeys.USERNAME),
       email: this.localStorageService.getItem(UserLocalStorageKeys.EMAIL),
-      role: parseInt(this.localStorageService.getItem(UserLocalStorageKeys.ROLE), 10) as UserRole,
+      role: {
+        id: parseInt(this.localStorageService.getItem(UserLocalStorageKeys.ROLE), 10) as UserRole,
+        label: ''
+      },
 
       ...this.getUserInfo()
     }
@@ -69,12 +72,14 @@ export class UserLocalStorageService {
     id: number
     username: string
     email: string
-    role: UserRole
+    role: {
+      id: UserRole
+    }
   }) {
     this.localStorageService.setItem(UserLocalStorageKeys.ID, user.id.toString())
     this.localStorageService.setItem(UserLocalStorageKeys.USERNAME, user.username)
     this.localStorageService.setItem(UserLocalStorageKeys.EMAIL, user.email)
-    this.localStorageService.setItem(UserLocalStorageKeys.ROLE, user.role.toString())
+    this.localStorageService.setItem(UserLocalStorageKeys.ROLE, user.role.id.toString())
   }
 
   flushLoggedInUser () {
@@ -120,7 +125,8 @@ export class UserLocalStorageService {
     const localStorageKeys: { [ id in keyof UserUpdateMe ]: string } = {
       nsfwPolicy: UserLocalStorageKeys.NSFW_POLICY,
       p2pEnabled: UserLocalStorageKeys.P2P_ENABLED,
-      autoPlayNextVideo: UserLocalStorageKeys.AUTO_PLAY_VIDEO,
+      autoPlayVideo: UserLocalStorageKeys.AUTO_PLAY_VIDEO,
+      autoPlayNextVideo: UserLocalStorageKeys.AUTO_PLAY_NEXT_VIDEO,
       autoPlayNextVideoPlaylist: UserLocalStorageKeys.AUTO_PLAY_VIDEO_PLAYLIST,
       theme: UserLocalStorageKeys.THEME,
       videoLanguages: UserLocalStorageKeys.VIDEO_LANGUAGES
@@ -162,6 +168,7 @@ export class UserLocalStorageService {
       UserLocalStorageKeys.NSFW_POLICY,
       UserLocalStorageKeys.P2P_ENABLED,
       UserLocalStorageKeys.AUTO_PLAY_VIDEO,
+      UserLocalStorageKeys.AUTO_PLAY_NEXT_VIDEO,
       UserLocalStorageKeys.AUTO_PLAY_VIDEO_PLAYLIST,
       UserLocalStorageKeys.THEME,
       UserLocalStorageKeys.VIDEO_LANGUAGES