Fixed crash on song deletion

This commit is contained in:
Prathamesh More 2022-02-16 00:02:41 +05:30
parent 5731b777f0
commit 63263b270b
3 changed files with 68 additions and 55 deletions

View file

@ -524,15 +524,6 @@ object MusicUtil : KoinComponent {
}
}
@RequiresApi(Build.VERSION_CODES.R)
fun deleteTracksR(activity: Activity, songs: List<Song>) {
removeFromQueue(songs)
val pendingIntent = MediaStore.createDeleteRequest(activity.contentResolver, songs.map {
getSongFileUri(it.id)
})
activity.startIntentSenderForResult(pendingIntent.intentSender, 45, null, 0, 0, 0, null)
}
fun songByGenre(genreId: Long): Song {
return repository.getSongByGenre(genreId)
}