Пример #1
0
        public User GetRecognizedPersonalizationProfileResult(Person person)
        {
            var users       = UserManager.Users;
            var defaultUser = users.FirstOrDefault(user => user.Policy.IsAdministrator);
            var config      = Plugin.Instance.Configuration;

            if (!config.EnableParentalControlVoiceRecognition)
            {
                return(defaultUser);
            }

            try
            {
                return(config.UserCorrelations.Exists(u => u.AlexaPersonId == person.personId)
                    ? UserManager.GetUserById(config.UserCorrelations.FirstOrDefault(u => u.AlexaPersonId == person.personId)?.EmbyUserId)
                    : defaultUser);
            }
            catch
            {
                return(defaultUser);
            }
        }
Пример #2
0
        public bool UserPersonalizationProfileExists(Person person)
        {
            var config = Plugin.Instance.Configuration;

            return(config.UserCorrelations.Exists(u => u.AlexaPersonId == person.personId));
        }