public Task Connect(ConnectDeviceRequest request)
        {
            if (request == null)
            {
                throw new ArgumentNullException(nameof(request));
            }
            if (string.IsNullOrWhiteSpace(request.Username))
            {
                throw new ArgumentException("Username is required", nameof(request));
            }
            if (string.IsNullOrWhiteSpace(request.Password))
            {
                throw new ArgumentException("Password is required", nameof(request));
            }

            var fifthplayDevices = GetFifthplayDevices(request);

            _credentialsRepository.SaveFifthplay(request.Username, request.Password);

            var knownFifthplayDevices = _deviceRepository.GetAll().Where(d => d.Type == DeviceType.Fifthplay);
            var devicesToAdd          = fifthplayDevices.Where(d => !knownFifthplayDevices.Any(k => k.Identifier == d.Identifier));
            var devicesToUpdate       = fifthplayDevices.Where(d => knownFifthplayDevices.Any(k => k.Identifier == d.Identifier));
            var devicesToDelete       = knownFifthplayDevices.Where(d => !fifthplayDevices.Any(f => f.Identifier == d.Identifier));

            _deviceRepository.Add(devicesToAdd);
            _deviceRepository.Update(devicesToUpdate);
            _deviceRepository.Delete(devicesToDelete);

            return(Task.FromResult(true));
        }