feat(search): add basic search functionality
this commit adds basic search feature. fix: https://codeberg.org/zyachel/libremdb/issues/9, https://github.com/zyachel/libremdb/issues/10
This commit is contained in:
36
src/utils/constants/find.ts
Normal file
36
src/utils/constants/find.ts
Normal file
@ -0,0 +1,36 @@
|
||||
/**
|
||||
* @constant
|
||||
*
|
||||
* key: the key for the query that we make to fetch results
|
||||
*
|
||||
* name: Nice name to display on the client side
|
||||
*
|
||||
* val: the value that is associated with the key. also used to fetch results.
|
||||
*
|
||||
* **IMPORTANT**: see sample response from backend, and form submission url to better understand how these objects are used.
|
||||
*/
|
||||
export const resultTypes = {
|
||||
types: [
|
||||
{ name: 'Titles', val: 'tt', id: 'TITLE' },
|
||||
{ name: 'People', val: 'nm', id: 'NAME' },
|
||||
{ name: 'Companies', val: 'co', id: 'COMPANY' },
|
||||
{ name: 'Keywords', val: 'kw', id: 'KEYWORD' },
|
||||
],
|
||||
key: 's',
|
||||
} as const;
|
||||
|
||||
/**
|
||||
* same as {@link resultTypes}.
|
||||
*/
|
||||
export const resultTitleTypes = {
|
||||
types: [
|
||||
{ name: 'Movies', val: 'ft', id: 'MOVIE' },
|
||||
{ name: 'TV', val: 'tv', id: 'TV' },
|
||||
{ name: 'TV Episodes', val: 'ep', id: 'TV_EPISODE' },
|
||||
{ name: 'Music Videos', val: 'mu', id: 'MUSIC_VIDEO' },
|
||||
{ name: 'Podcasts', val: 'ps', id: 'PODCAST_SERIES' },
|
||||
{ name: 'Podcast Episodes', val: 'pe', id: 'PODCAST_EPISODE' },
|
||||
{ name: 'Video Games', val: 'vg', id: 'VIDEO_GAME' },
|
||||
],
|
||||
key: 'ttype',
|
||||
} as const;
|
Reference in New Issue
Block a user