Clear scene tagger results on new search (#1526)

* Clear search results when searching in tagger
* Fix oshash messageID
This commit is contained in:
WithoutPants 2021-06-23 13:00:58 +10:00 committed by GitHub
parent 4e26633abb
commit 4e08e37d74
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 1 deletions

View file

@ -195,7 +195,17 @@ const TaggerList: React.FC<ITaggerListProps> = ({
inputForm?.current?.reset();
}, [config.mode, config.blacklist]);
function clearSceneSearchResult(sceneID: string) {
// remove sceneID results from the results object
const { [sceneID]: _removedResult, ...newSearchResults } = searchResults;
const { [sceneID]: _removedError, ...newSearchErrors } = searchErrors;
setSearchResults(newSearchResults);
setSearchErrors(newSearchErrors);
}
const doBoxSearch = (sceneID: string, searchVal: string) => {
clearSceneSearchResult(sceneID);
stashBoxSceneQuery(searchVal, selectedEndpoint.index)
.then((queryData) => {
const s = selectScenes(queryData.data?.queryStashBoxScene);

View file

@ -49,7 +49,7 @@ export function makeCriteria(type: CriterionType = "none") {
case "checksum":
case "oshash":
return new StringCriterion(
new MandatoryStringCriterionOption(type, type)
new MandatoryStringCriterionOption("media_info.hash", type, type)
);
case "rating":
return new NumberCriterion(RatingCriterionOption);