diff --git a/App.tsx b/App.tsx index e5b8d85..5b7a91a 100644 --- a/App.tsx +++ b/App.tsx @@ -1,10 +1,10 @@ import React from 'react'; import { RecoilRoot } from 'recoil'; -import ArtistsList from './src/components/ArtistsList'; +import SettingsView from './src/components/Settings'; const App = () => ( - + ); diff --git a/src/clients.ts b/src/clients.ts new file mode 100644 index 0000000..c4a579d --- /dev/null +++ b/src/clients.ts @@ -0,0 +1,6 @@ +import { MusicDb } from "./storage/music"; +import { SettingsDb } from "./storage/settings"; +import { SubsonicApiClient } from "./subsonic/api"; + +export const musicDb = new MusicDb(); +export const settingsDb = new SettingsDb(); diff --git a/src/components/Settings.tsx b/src/components/Settings.tsx new file mode 100644 index 0000000..72cbfb8 --- /dev/null +++ b/src/components/Settings.tsx @@ -0,0 +1,37 @@ +import React from 'react'; +import { Button, View } from 'react-native'; +import { musicDb, settingsDb } from '../clients'; + +const DbControls = () => { + + const recreateMusicDb = async () => { + try { await musicDb.deleteDb(); } catch {} + await musicDb.createDb(); + } + + const recreateSettingsDb = async () => { + try { await settingsDb.deleteDb(); } catch {} + await settingsDb.createDb(); + } + + return ( + +