Skip to content
Snippets Groups Projects
Commit 91b8ec26 authored by Geoffrey Métais's avatar Geoffrey Métais
Browse files

Catch Exception when getting title

parent 704d8bdf
No related branches found
No related tags found
No related merge requests found
......@@ -239,7 +239,7 @@ object MediaUtils {
}
}
fun retrieveMediaTitle(mw: MediaWrapper) {
fun retrieveMediaTitle(mw: MediaWrapper) = try {
VLCApplication.getAppContext().contentResolver.query(mw.uri, null, null, null, null)?.use {
val nameIndex = it.getColumnIndex(OpenableColumns.DISPLAY_NAME)
if (nameIndex > -1 && it.count > 0) {
......@@ -247,7 +247,7 @@ object MediaUtils {
if (!it.isNull(nameIndex)) mw.title = it.getString(nameIndex)
}
}
}
} catch (ignored: UnsupportedOperationException) {}
fun deletePlaylist(playlist: Playlist) = runBackground(Runnable { playlist.delete() })
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment