diff --git a/src/screens/Settings/components/Cache.tsx b/src/screens/Settings/components/Cache.tsx
new file mode 100644
index 0000000..910ae1d
--- /dev/null
+++ b/src/screens/Settings/components/Cache.tsx
@@ -0,0 +1,26 @@
+import React, { useCallback } from 'react';
+import TrackPlayer from 'react-native-track-player';
+import { SubHeader } from 'components/Typography';
+import { Text, Button } from 'react-native';
+import { THEME_COLOR } from 'CONSTANTS';
+import { useDispatch } from 'react-redux';
+import music from 'store/music';
+
+export default function CacheSettings() {
+ const dispatch = useDispatch();
+ const handleClearCache = useCallback(() => {
+ // Dispatch an action to reset the music subreducer state
+ dispatch(music.actions.reset());
+
+ // Also clear the TrackPlayer queue
+ TrackPlayer.reset();
+ }, [dispatch]);
+
+ return (
+ <>
+ Cache
+ If you have updated your Jellyfin library, but the app is holding on to cached assets, you can forcefully clear the cache using this button. This will force the app to fetch the library from scratch.
+
+ >
+ );
+}
\ No newline at end of file
diff --git a/src/screens/Settings/components/Library.tsx b/src/screens/Settings/components/Library.tsx
new file mode 100644
index 0000000..c9dda18
--- /dev/null
+++ b/src/screens/Settings/components/Library.tsx
@@ -0,0 +1,44 @@
+import styled from 'styled-components/native';
+import { useNavigation } from '@react-navigation/native';
+import React, { useCallback } from 'react';
+import { Text, Button } from 'react-native';
+import { THEME_COLOR } from 'CONSTANTS';
+import { SubHeader } from 'components/Typography';
+import { colors } from 'components/Colors';
+import { NavigationProp } from '../..';
+import { useTypedSelector } from 'store';
+
+const InputContainer = styled.View`
+ margin: 10px 0;
+`;
+
+const Input = styled.TextInput`
+ padding: 15px;
+ margin-top: 5px;
+ border-radius: 5px;
+`;
+
+export default function LibrarySettings() {
+ const { jellyfin } = useTypedSelector(state => state.settings);
+ const navigation = useNavigation();
+ const handleSetLibrary = useCallback(() => navigation.navigate('SetJellyfinServer'), [navigation]);
+
+ return (
+ <>
+ Jellyfin Library
+
+ Jellyfin Server URL
+
+
+
+ Jellyfin Access Token
+
+
+
+ Jellyfin User ID
+
+
+
+ >
+ );
+}
\ No newline at end of file
diff --git a/src/screens/Settings/index.tsx b/src/screens/Settings/index.tsx
index a184056..e50e50e 100644
--- a/src/screens/Settings/index.tsx
+++ b/src/screens/Settings/index.tsx
@@ -1,55 +1,18 @@
-import React, { useCallback } from 'react';
-import { View, Text, SafeAreaView, Button, StyleSheet } from 'react-native';
-import { ScrollView } from 'react-native-gesture-handler';
-import styled from 'styled-components/native';
-import { useSelector } from 'react-redux';
-import { AppState } from 'store';
-import { useNavigation } from '@react-navigation/native';
-import { NavigationProp } from '..';
-import { THEME_COLOR } from 'CONSTANTS';
+import React from 'react';
+import { View, SafeAreaView, ScrollView } from 'react-native';
import { Header } from 'components/Typography';
import { colors } from 'components/Colors';
-
-const InputContainer = styled.View`
- margin: 10px 0;
-`;
-
-const Input = styled.TextInput`
- padding: 15px;
- margin-top: 5px;
- border-radius: 5px;
-`;
+import Library from './components/Library';
+import Cache from './components/Cache';
export default function Settings() {
- const { jellyfin, bitrate } = useSelector((state: AppState) => state.settings);
- const navigation = useNavigation();
- const handleClick = useCallback(() => navigation.navigate('SetJellyfinServer'), [navigation]);
-
return (
-
- Jellyfin Server URL
-
-
-
- Jellyfin Access Token
-
-
-
- Jellyfin User ID
-
-
-
- {/* The bitrate setting is hidden for now, since Jellyfin does not appear to support custom bitrates */}
- {/*
- Bitrate
-
-
-
- */}
+
+
diff --git a/src/store/music/index.ts b/src/store/music/index.ts
index c0a026f..5819976 100644
--- a/src/store/music/index.ts
+++ b/src/store/music/index.ts
@@ -31,7 +31,9 @@ const initialState: State = {
const music = createSlice({
name: 'music',
initialState,
- reducers: {},
+ reducers: {
+ reset: () => initialState,
+ },
extraReducers: builder => {
/**
* Fetch All albums