mirror of
https://github.com/pawelmalak/flame.git
synced 2026-03-09 22:13:12 +08:00
Added warning about unsupported prefix. Added support for Spotify search. Edited README file
This commit is contained in:
@@ -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;
|
||||
}
|
||||
@@ -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/"
|
||||
}
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user