-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Miha/Kevin Audio Download/Delete #35
base: main
Are you sure you want to change the base?
Conversation
* built app, added configuration, and queries demo as a screen. * removing unnecessary firebase env variable comments
…val-mobile into miha-kevin-audio-download
…eprint/cultural-survival-mobile into miha-kevin-audio-download
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good to merge!
src/firebase/AudioDemos.tsx
Outdated
const audios = await downLoadAudio(audio_id); | ||
const didItDownload = await getInfoAsync(audios); | ||
// eslint-disable-next-line no-console | ||
console.log(didItDownload); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
isDownloaded instead
src/firebase/AudioDemos.tsx
Outdated
console.log(didItDownload); | ||
|
||
deleteAudio(audios); | ||
const didItDelete = await getInfoAsync(audios); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
isDeleted instead
src/firebase/AudioDemos.tsx
Outdated
|
||
export default function QueriesDemo() { | ||
const [audio] = useState<Audio[]>([]); | ||
// eslint-disable-next-line camelcase |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
change to camelcase
src/firebase/AudioDemos.tsx
Outdated
import { Button, Text, TextInput, View } from 'react-native'; | ||
import { getInfoAsync } from 'expo-file-system'; | ||
import { Audio } from '../types/schema'; | ||
// import { getAllAudio, getAudioID } from './queries/audioQueries'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove
src/firebase/AudioDemos.tsx
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we shouldn't be using an audio demos file, move this elsewhere or delete the file
src/screens/PlayScreen/Play.tsx
Outdated
console.log(didItDownload); | ||
|
||
deleteAudio(audios); | ||
const didItDelete = await getInfoAsync(audios); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
isDeleted
yarn.lock
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we should not have yarn; only use npm
App.tsx
Outdated
import RootNavigation from './src/navigation/RootNavigator'; | ||
// import QueriesDemo from './src/firebase/QueriesDemo'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
these should be removed
App.tsx
Outdated
await SplashScreen.hideAsync(); | ||
} | ||
}, [resourcesLoaded]); | ||
|
||
return !resourcesLoaded ? null : ( | ||
<View style={styles.container} onLayout={onLayoutRootView}> | ||
{/* <AudioDemos /> */} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove
src/firebase/AudioDemos.tsx
Outdated
console.log(didItDelete); | ||
}; | ||
|
||
// useEffect(() => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should be removed
🎉 What's new in this PR 🎉
Audio can now be downloaded to Expo File System and deleted from the File System.
☁️ ☁️ Description ☁️ ☁️
With the audio ID, audio will be downloaded from Firebase into the Expo File System. We have also implemented a delete function that will delete the audio from the File System using the deleteAsync function that takes in the Audio's ID that needs to be deleted.
Screenshots 📲
⚡ How to review ⚡
We tested this by integrating Audio Demo into the play screen. There, you can input any valid audio ID from cs-firebase and on terminal you should get log info messages that let you know if the audio exists in FileSystema and if its deleted. We set it up so that after an ID is inputted, it will get downloaded and then immediately deleted. These should be console logged to terminal to show if it exists or not.
🌱 Next steps 🌱
Relevant Links 🔗
Expo File System Documentation: https://docs.expo.dev/versions/latest/sdk/filesystem/#saf-uri
Online sources ℹ️
Related PRs 🙌
CC: @davidqing6432