Added warning about unsupported prefix. Added support for Spotify search. Edited README file

This commit is contained in:
unknown
2021-06-25 10:42:44 +02:00
parent aec00982ba
commit 0c3a27febd
9 changed files with 73 additions and 38 deletions

View File

@@ -3,7 +3,7 @@ import { Query } from '../interfaces';
import { searchConfig } from '.';
export const searchParser = (searchQuery: string): void => {
export const searchParser = (searchQuery: string): boolean => {
const space = searchQuery.indexOf(' ');
const prefix = searchQuery.slice(1, space);
const search = encodeURIComponent(searchQuery.slice(space + 1));
@@ -18,5 +18,9 @@ export const searchParser = (searchQuery: string): void => {
} else {
window.open(`${query.template}${search}`);
}
return true;
}
return false;
}

View File

@@ -34,6 +34,11 @@
"name": "The Movie Database",
"prefix": "mv",
"template": "https://www.themoviedb.org/search?query="
},
{
"name": "Spotify",
"prefix": "sp",
"template": "https://open.spotify.com/search/"
}
]
}