public async Task SetOptions(SyncJobRequest request)
        {
            IsLoading = true;
            _request = request;
            var apiClient = _connectionManager.GetApiClient(App.ServerInfo.Id);

            try
            {
                _logger.Info("Getting sync options");
                _options = await apiClient.GetSyncOptions(request);
                if (_options != null && _options.Targets.Any())
                {
                    var thisDevice = _options.Targets.FirstOrDefault(x => x.Id == apiClient.DeviceId);
                    if (thisDevice == null)
                    {
                        TargetDevices.ItemsSource = _options.Targets;
                        TargetDevices.SelectedItem = _options.Targets.FirstOrDefault();
                    }
                    else
                    {
                        thisDevice.Name = string.Format(AppResources.LabelThisDevice, thisDevice.Name);
                        _options.Targets.Remove(thisDevice);
                        _options.Targets.Insert(0, thisDevice);

                        TargetDevices.ItemsSource = _options.Targets;
                        TargetDevices.SelectedItem = thisDevice;
                        //GetOptionsForDevice(thisDevice.Id).ConfigureAwait(false);
                    }
                }
                else
                {
                    Close();
                }
            }
            catch (HttpException ex)
            {
                Close();
                Utils.HandleHttpException("SetOptions()", ex, SimpleIoc.Default.GetInstance<INavigationService>(), _logger);
            }

            IsLoading = false;
        }
        private async Task GetOptionsForDevice(string deviceId)
        {
            IsLoading = true;
            _request.TargetId = deviceId;
            var apiClient = _connectionManager.GetApiClient(App.ServerInfo.Id);

            try
            {
                _logger.Info("Getting sync options for device ({0})", deviceId);
                _options = await apiClient.GetSyncOptions(_request);
                if (_options != null)
                {
                    _unwatched = _options.Options.Contains(SyncJobOption.UnwatchedOnly);
                    _itemLimit = _options.Options.Contains(SyncJobOption.ItemLimit);
                    _autoSync = _options.Options.Contains(SyncJobOption.SyncNewContent);
                    _profileNeeded = _options.Options.Contains(SyncJobOption.Profile) && _options.ProfileOptions.Any();
                    _qualityNeeded = _options.Options.Contains(SyncJobOption.Quality);

                    if (_qualityNeeded)
                    {
                        QualityPicker.ItemsSource = _options.QualityOptions;
                        QualityPicker.SelectedItem = QualityPicker.Items.FirstOrDefault(x => (x as SyncQualityOption).IsDefault);
                    }

                    if (_profileNeeded)
                    {
                        var profiles = _options.ProfileOptions.Select(x => x.Localise()).ToList();
                        ProfilePicker.ItemsSource = profiles;
                        ProfilePicker.SelectedItem = ProfilePicker.Items.FirstOrDefault(x => (x as SyncProfileOption).IsDefault);
                    }

                    ProfilePicker.Visibility = _profileNeeded ? Visibility.Visible : Visibility.Collapsed;
                    QualityPicker.Visibility = _qualityNeeded ? Visibility.Visible : Visibility.Collapsed;
                    ItemLimitBox.Visibility = _itemLimit ? Visibility.Visible : Visibility.Collapsed;
                    AutoSyncVideos.Visibility = _autoSync ? Visibility.Visible : Visibility.Collapsed;
                    UnwatchedVideos.Visibility = _unwatched ? Visibility.Visible : Visibility.Collapsed;
                }
                else
                {
                    Close();
                }
            }
            catch (HttpException ex)
            {
                Close();
                Utils.HandleHttpException("SetOptions()", ex, SimpleIoc.Default.GetInstance<INavigationService>(), _logger);
            }

            IsLoading = false;
        }