Created
April 7, 2018 19:36
-
-
Save AOrobator/a96e9dbe52df3608684350996150e935 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
override fun scanSongIntoLibrary(filePath: String): SongId { | |
var newSongId: SongId = InvalidSongId | |
realmTransaction { | |
if (getSongForFilepath(it, filePath) == null) { | |
val song = Song { | |
id = Database.getNextId(it, Song::class.java) | |
newSongId = // get next ValidSongId | |
// Initialize title, artist, and album for the song | |
} | |
it.copyToRealm(song) | |
} | |
} | |
return newSongId | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment