fix datasource filtering weh All is seleceted

This commit is contained in:
millmanorama 2018-08-24 15:29:40 +02:00
parent 6b2a120c6a
commit 436ad753d5
2 changed files with 7 additions and 7 deletions

View File

@ -337,7 +337,7 @@ public final class DrawableDB {
statement.setObject(1, groupKey.getValue()); statement.setObject(1, groupKey.getValue());
if (groupKey.getDataSource() != null if (groupKey.getDataSource().isPresent()
&& (groupKey.getAttribute() == DrawableAttribute.PATH)) { && (groupKey.getAttribute() == DrawableAttribute.PATH)) {
statement.setObject(2, groupKey.getDataSourceObjId()); statement.setObject(2, groupKey.getDataSourceObjId());
} }
@ -636,7 +636,7 @@ public final class DrawableDB {
try { try {
String groupSeenQueryStmt; String groupSeenQueryStmt;
if (groupKey.getDataSourceObjId() != 0) { if (groupKey.getDataSource().isPresent()) {
groupSeenQueryStmt = String.format("seen FROM " + GROUPS_TABLENAME + " WHERE value = \'%s\' AND attribute = \'%s\' AND data_source_obj_id = %d", groupKey.getValueDisplayName(), groupKey.getAttribute().attrName.toString(), groupKey.getDataSourceObjId()); groupSeenQueryStmt = String.format("seen FROM " + GROUPS_TABLENAME + " WHERE value = \'%s\' AND attribute = \'%s\' AND data_source_obj_id = %d", groupKey.getValueDisplayName(), groupKey.getAttribute().attrName.toString(), groupKey.getDataSourceObjId());
} else { } else {
groupSeenQueryStmt = String.format("seen FROM " + GROUPS_TABLENAME + " WHERE value = \'%s\' AND attribute = \'%s\'", groupKey.getValueDisplayName(), groupKey.getAttribute().attrName.toString()); groupSeenQueryStmt = String.format("seen FROM " + GROUPS_TABLENAME + " WHERE value = \'%s\' AND attribute = \'%s\'", groupKey.getValueDisplayName(), groupKey.getAttribute().attrName.toString());
@ -657,11 +657,11 @@ public final class DrawableDB {
public void markGroupSeen(GroupKey<?> gk, boolean seen) { public void markGroupSeen(GroupKey<?> gk, boolean seen) {
try { try {
String updateSQL; String updateSQL;
if (gk.getDataSourceObjId() != 0) { if (gk.getDataSource().isPresent()) {
updateSQL = String.format("set seen = %d where value = \'%s\' and attribute = \'%s\' and data_source_obj_id = %d", seen ? 1 : 0, updateSQL = String.format("SET seen = %d WHERE VALUE = \'%s\' AND attribute = \'%s\' AND data_source_obj_id = %d", seen ? 1 : 0,
gk.getValueDisplayName(), gk.getAttribute().attrName.toString(), gk.getDataSourceObjId()); gk.getValueDisplayName(), gk.getAttribute().attrName.toString(), gk.getDataSourceObjId());
} else { } else {
updateSQL = String.format("set seen = %d where value = \'%s\' and attribute = \'%s\'", seen ? 1 : 0, updateSQL = String.format("SET seen = %d WHERE VALUE = \'%s\' AND attribute = \'%s\'", seen ? 1 : 0,
gk.getValueDisplayName(), gk.getAttribute().attrName.toString()); gk.getValueDisplayName(), gk.getAttribute().attrName.toString());
} }
tskCase.getCaseDbAccessManager().update(GROUPS_TABLENAME, updateSQL); tskCase.getCaseDbAccessManager().update(GROUPS_TABLENAME, updateSQL);
@ -1253,7 +1253,7 @@ public final class DrawableDB {
if (null != dataSource) { if (null != dataSource) {
return countFilesWhere(" data_source_obj_id = "); return countFilesWhere(" data_source_obj_id = ");
} else { } else {
return countFilesWhere(" true "); return countFilesWhere(" 1 ");
} }
} }

View File

@ -625,7 +625,7 @@ public class GroupManager {
/* /*
* for attributes other than path we can't be sure a group is * for attributes other than path we can't be sure a group is
* fully analyzed because we don't know all the files that will * fully analyzed because we don't know all the files that will
* be a part of that group,. just show them no matter what. * be a part of that group. just show them no matter what.
*/ */
try { try {