Пример #1
0
            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
        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);
        }