コード例 #1
0
ファイル: User.cs プロジェクト: swtrse/ShokoServer
            public SVR_JMMUser GetServerModel()
            {
                var user = new SVR_JMMUser
                {
                    Username              = Username,
                    JMMUserID             = ID,
                    Password              = Password,
                    HideCategories        = string.Join(',', TagBlacklist),
                    IsAdmin               = IsAdmin ? 1 : 0,
                    IsTraktUser           = CommunitySites.Contains(global::Shoko.Models.Enums.CommunitySites.Trakt) ? 1 : 0,
                    CanEditServerSettings = IsAdmin ? 1 : 0,
                    IsAniDBUser           = CommunitySites.Contains(global::Shoko.Models.Enums.CommunitySites.AniDB) ? 1 : 0,
                };

                return(user);
            }
コード例 #2
0
ファイル: User.cs プロジェクト: swtrse/ShokoServer
        public SVR_JMMUser MergeServerModel(SVR_JMMUser existing)
        {
            var user = new SVR_JMMUser
            {
                Username              = Username,
                JMMUserID             = ID,
                HideCategories        = string.Join(',', TagBlacklist),
                IsAdmin               = IsAdmin ? 1 : 0,
                IsTraktUser           = CommunitySites.Contains(global::Shoko.Models.Enums.CommunitySites.Trakt) ? 1 : 0,
                CanEditServerSettings = IsAdmin ? 1 : 0,
                IsAniDBUser           = CommunitySites.Contains(global::Shoko.Models.Enums.CommunitySites.AniDB) ? 1 : 0,
                Password              = existing?.Password ?? string.Empty,
                PlexToken             = existing?.PlexToken,
                PlexUsers             = existing?.PlexUsers ?? string.Empty
            };

            return(user);
        }