Skip to content

Instantly share code, notes, and snippets.

@AOrobator
Created April 7, 2018 16:21
Show Gist options
  • Save AOrobator/da34d39c7eb5a67ce1ac377a23bd1866 to your computer and use it in GitHub Desktop.
Save AOrobator/da34d39c7eb5a67ce1ac377a23bd1866 to your computer and use it in GitHub Desktop.
OnUnscannedSongClicked
fun onUnscannedSongClicked(song: DirectoryItemSong) {
val songFile = File(song.path)
if (songFile.extension in supportedFormats) {
target?.showLoading()
songRepo
.addSongToLibrary(song.path)
.subscribe {
target?.hideLoading()
target?.playSong(it)
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment