Skip to content

Commit

Permalink
Remove SHOW_NOT_GROUPED option since it is not needed.
Browse files Browse the repository at this point in the history
  • Loading branch information
matiasdelellis committed Oct 14, 2020
1 parent bb4f7f2 commit 7f72630
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 62 deletions.
36 changes: 1 addition & 35 deletions js/admin.js
Original file line number Diff line number Diff line change
Expand Up @@ -214,42 +214,9 @@ $(document).ready(function() {
});
});


/*
* Show not clustered people
* Utils
*/
function getNotGrouped() {
$.ajax({
type: 'GET',
url: OC.generateUrl('apps/facerecognition/getappvalue'),
data: {
'type': 'show_not_grouped',
},
success: function (data) {
if (data.status === state.OK) {
$('#showNotGrouped').prop('checked', data.value);
}
}
});
}

$('#showNotGrouped').click(function() {
var checked = $(this).is(':checked');
var self = this;
$.ajax({
type: 'POST',
url: OC.generateUrl('apps/facerecognition/setappvalue'),
data: {
'type': 'show_not_grouped',
'value': checked
},
error: function () {
$('#showNotGrouped').prop('checked', !checked);
OC.Notification.showTemporary(t('facerecognition', 'The change could not be applied.'));
}
});
})

function getFourByThreeRelation(area) {
var width = Math.sqrt(area * 4 / 3);
var height = (width * 3 / 4);
Expand All @@ -263,7 +230,6 @@ $(document).ready(function() {
getImageArea();
getSensitivity();
getMinConfidence();
getNotGrouped();

checkProgress();

Expand Down
6 changes: 0 additions & 6 deletions lib/Controller/SettingsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -194,9 +194,6 @@ public function setAppValue($type, $value) {
$this->settingsService->setNeedRecreateClusters(true, $user->getUID());
});
break;
case SettingsService::SHOW_NOT_GROUPED_KEY:
$this->settingsService->setShowNotGrouped($value === 'true' ? true : false);
break;
case SettingsService::OBFUSCATE_FACE_THUMBS_KEY:
$this->settingsService->setObfuscateFaces(!$this->settingsService->getObfuscateFaces());
break;
Expand Down Expand Up @@ -233,9 +230,6 @@ public function getAppValue($type) {
case SettingsService::ANALYSIS_IMAGE_AREA_KEY:
$value = $this->settingsService->getAnalysisImageArea();
break;
case SettingsService::SHOW_NOT_GROUPED_KEY:
$value = $this->settingsService->getShowNotGrouped();
break;
default:
break;
}
Expand Down
13 changes: 0 additions & 13 deletions lib/Service/SettingsService.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,6 @@ class SettingsService {
const DEFAULT_MINIMUM_FACE_SIZE = '40';
const MAXIMUM_MINIMUM_FACE_SIZE = '250';

/** Show single persons on clustes view */
const SHOW_NOT_GROUPED_KEY = 'show_not_grouped';
const DEFAULT_SHOW_NOT_GROUPED = 'false';

/** User setting what indicates if has the analysis enabled */
const USER_ENABLED_KEY = 'enabled';
const DEFAULT_USER_ENABLED = 'false';
Expand Down Expand Up @@ -236,15 +232,6 @@ public function setMinimumConfidence($confidence) {
$this->config->setAppValue(Application::APP_NAME, self::MINIMUM_CONFIDENCE_KEY, $confidence);
}

public function getShowNotGrouped(): bool {
$show = $this->config->getAppValue(Application::APP_NAME, self::SHOW_NOT_GROUPED_KEY, self::DEFAULT_SHOW_NOT_GROUPED);
return ($show === 'true');
}

public function setShowNotGrouped(bool $show) {
$this->config->setAppValue(Application::APP_NAME, self::SHOW_NOT_GROUPED_KEY, $show ? "true" : "false");
}

/**
* The next settings are advanced preferences that are not available in gui.
* See: https://github.com/matiasdelellis/facerecognition/wiki/Settings#hidden-settings
Expand Down
8 changes: 0 additions & 8 deletions templates/settings/admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,14 +55,6 @@
<a id="save-min-confidence" class="icon-align icon-edit" style="display: none;" title="<?php p($l->t('Save'));?>" href="#"></a>
</p>
<br>
<h3>
<?php p($l->t('Additional settings'));?>
</h3>
<p>
<input id="showNotGrouped" name="showNotGrouped" type="checkbox" class="checkbox">
<label for="showNotGrouped"><?php p($l->t('Show persons with only one face found'));?></label><br>
</p>
<br>
<h3>
<?php p($l->t('Configuration information'));?>
<span class="status success<?php if(!($_['model-version'] > 0 && $_['meet-dependencies'])):?> error<?php endif;?>"></span>
Expand Down

0 comments on commit 7f72630

Please sign in to comment.