diff --git a/CHANGELOG.md b/CHANGELOG.md
index 023e8e0..2872e21 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,9 @@
# Changelog
+## 1.3.0
+* Improved species search and matching
+
+
## 1.2.0
* Hide/show current character profile with Ctrl+P or Command+P
* Navigate back and forward in character profile view history
diff --git a/chat/CharacterSearch.vue b/chat/CharacterSearch.vue
index 3f2c39c..94f8150 100644
--- a/chat/CharacterSearch.vue
+++ b/chat/CharacterSearch.vue
@@ -11,9 +11,9 @@
v-model="data[item]" :placeholder="l('filter')" :title="l('characterSearch.' + item)" :options="options[item]" :key="item">
-
- {{s.option.name}}
+ {{s.option.shortName}} {{s.option.details}}
@@ -61,7 +61,7 @@
import {EventBus} from './preview/event-bus';
import CharacterSearchHistory from './CharacterSearchHistory.vue';
import { Matcher } from '../learn/matcher';
- import { Species, speciesNames } from '../learn/matcher-types';
+ import { Species, speciesMapping, speciesNames } from '../learn/matcher-types';
type Options = {
kinks: SearchKink[],
@@ -250,27 +250,38 @@
return !!_.find(this.data.species, (s: SearchSpecies) => (s.id === species));
}
-
getSpeciesOptions(): SearchSpecies[] {
const species = _.map(
- _.filter(Species, (s) => (_.isString(s))) as unknown[] as string[],
- (speciesName: keyof typeof Species): SearchSpecies => {
- const speciesId: number = Species[speciesName];
+ speciesMapping,
+ (keywords: string[], speciesIdStr: Species): SearchSpecies => {
+ // const speciesId: number = Species[speciesName];
+ const details = `${keywords.join(', ').substr(0, 24)}...`;
+ const speciesId = parseInt(speciesIdStr as any, 10);
if (speciesId in speciesNames) {
+ const name = `${speciesNames[speciesId].substr(0, 1).toUpperCase()}${speciesNames[speciesId].substr(1)}`;
+
return {
- name: `${speciesNames[speciesId].substr(0, 1).toUpperCase()}${speciesNames[speciesId].substr(1)} (species)`,
+ details,
+ name: `${name} (species)`,
+ shortName: name,
id: speciesId
};
}
+ const speciesName = Species[speciesId];
+
return {
+ details,
name: `${speciesName}s (species)`,
+ shortName: `${speciesName}s`,
id: speciesId
};
}
) as unknown[] as SearchSpecies[];
+ // console.log('SPECIES', species);
+
return _.sortBy(species, 'name');
}
@@ -364,6 +375,12 @@