1
0
mirror of https://github.com/Radarr/Radarr.git synced 2026-04-21 22:05:43 -04:00

Fixed: Backend Updates from Sonarr

Co-Authored-By: Mark McDowall <markus101@users.noreply.github.com>
Co-Authored-By: taloth <taloth@users.noreply.github.com>
This commit is contained in:
Qstick
2019-06-30 21:50:01 -04:00
parent d178dce0d3
commit 91ab518dfb
131 changed files with 2422 additions and 988 deletions
@@ -154,8 +154,33 @@ class MovieSearchInput extends Component {
}
onSuggestionsFetchRequested = ({ value }) => {
const fuse = new Fuse(this.props.movies, fuseOptions);
const suggestions = fuse.search(value);
const { movies } = this.props;
let suggestions = [];
if (value.length === 1) {
suggestions = movies.reduce((acc, s) => {
if (s.firstCharacter === value.toLowerCase()) {
acc.push({
item: s,
indices: [
[0, 0]
],
matches: [
{
value: s.title,
key: 'title'
}
],
arrayIndex: 0
});
}
return acc;
}, []);
} else {
const fuse = new Fuse(movies, fuseOptions);
suggestions = fuse.search(value);
}
this.setState({ suggestions });
}