Delete data for unused classes

This commit is contained in:
M66B 2022-04-28 16:27:30 +02:00
parent 9a3b8a7ad5
commit 09a9c51f69
1 changed files with 4 additions and 2 deletions

View File

@ -181,9 +181,11 @@ public class MessageClassifier {
DB db = DB.getInstance(context);
for (String clazz : new ArrayList<>(classMessages.get(message.account).keySet())) {
EntityFolder folder = db.folder().getFolderByName(message.account, clazz);
if (folder == null) {
if (folder == null || !folder.auto_classify_source) {
EntityLog.log(context, EntityLog.Type.Classification, message,
"Classifier deleting folder class=" + message.account + ":" + clazz);
"Classifier deleting folder" +
" class=" + message.account + ":" + clazz +
" exists=" + (folder != null));
classMessages.get(message.account).remove(clazz);
for (String word : wordClassFrequency.get(message.account).keySet())
wordClassFrequency.get(message.account).get(word).remove(clazz);