bazarr/frontend/src/apis/raw/files.ts

28 lines
532 B
TypeScript
Raw Normal View History

2021-03-25 14:22:43 +00:00
import BaseApi from "./base";
class FilesApi extends BaseApi {
constructor() {
super("/files");
}
2021-08-17 14:52:50 +00:00
async browse(name: string, path?: string) {
const response = await this.get<FileTree[]>(name, { path });
return response;
2021-03-25 14:22:43 +00:00
}
2021-08-17 14:52:50 +00:00
async bazarr(path?: string) {
2021-03-25 14:22:43 +00:00
return this.browse("", path);
}
2021-08-17 14:52:50 +00:00
async sonarr(path?: string) {
2021-03-25 14:22:43 +00:00
return this.browse("/sonarr", path);
}
2021-08-17 14:52:50 +00:00
async radarr(path?: string) {
2021-03-25 14:22:43 +00:00
return this.browse("/radarr", path);
}
}
const filesApi = new FilesApi();
export default filesApi;