remade frontend
This commit is contained in:
parent
02281120dc
commit
36d99b1e35
45 changed files with 1290 additions and 4979 deletions
32
frontend/src/Lib/Search.ts
Normal file
32
frontend/src/Lib/Search.ts
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
import type { Server } from "./Servers";
|
||||
|
||||
export interface SearchResult {
|
||||
name: string;
|
||||
id: string;
|
||||
serverId: string;
|
||||
type: SearchResultType;
|
||||
episodes: number;
|
||||
}
|
||||
|
||||
export type SearchResultType = "movie" | "tv show" | "music";
|
||||
|
||||
export const search = async (searchTerm: string, serverId: string): Promise<Array<SearchResult>> => {
|
||||
return [{
|
||||
name: "Test Result",
|
||||
episodes: 0,
|
||||
id: "awawa",
|
||||
serverId: serverId,
|
||||
type: "movie"
|
||||
},
|
||||
{
|
||||
name: "Test result 2",
|
||||
episodes: 0,
|
||||
id: "awawa 2",
|
||||
serverId: serverId,
|
||||
type: "movie"
|
||||
}];
|
||||
}
|
||||
|
||||
export const getUrlForSearchResult = (result: SearchResult, server: Server): string => {
|
||||
return `${server.url}/web/#/details?id=${result.id}`;
|
||||
}
|
||||
25
frontend/src/Lib/Servers.ts
Normal file
25
frontend/src/Lib/Servers.ts
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
|
||||
export interface Server {
|
||||
name: string;
|
||||
id: string;
|
||||
online?: boolean;
|
||||
owner: string;
|
||||
url: string;
|
||||
}
|
||||
|
||||
export const getServerList = async (): Promise<Array<Server>> => {
|
||||
return [{
|
||||
id: "asdf",
|
||||
name: "test server",
|
||||
owner: "meeeee",
|
||||
url: "https://jellyfin.foxhawk.co.uk",
|
||||
online: true
|
||||
},
|
||||
{
|
||||
id: "qwer",
|
||||
name: "test server 2",
|
||||
owner: "someone else",
|
||||
url: "https://jellyfin.foxhawk.co.uk",
|
||||
online: true
|
||||
}];
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue