Clean old unused tags when deleting a tag

This commit is contained in:
tcit
2014-04-30 12:14:20 +02:00
parent 78bddb22be
commit 9c743ab965
2 changed files with 30 additions and 1 deletions

View File

@ -558,7 +558,7 @@ class Poche
}
}
}
$this->messages->add('s', _('the tag has been applied successfully'));
$this->messages->add('s', _('The tag has been applied successfully'));
Tools::redirect();
break;
case 'remove_tag' :
@ -570,6 +570,10 @@ class Poche
Tools::redirect();
}
$this->store->removeTagForEntry($id, $tag_id);
Tools::logm('tag entry deleted');
$this->store->cleanUnusedTags();
Tools::logm('old tags cleaned');
$this->messages->add('s', _('The tag has been successfully deleted'));
Tools::redirect();
break;
default:
@ -1131,6 +1135,13 @@ class Poche
$this->messages->add('s', _('Cache deleted.'));
Tools::redirect();
}
public function cleanTags() {
$this->store->cleanUnusedTags();
$this->messages->add('s', _('The unused tags have been cleaned.'));
Tools::logm('clean tags');
Tools::redirect();
}
/**
* return new purifier object with actual config