rename song ID field to resolverID

This commit is contained in:
tibbi 2018-05-18 13:54:12 +02:00
parent d468e03ccd
commit 3d92f34fe3
3 changed files with 4 additions and 4 deletions

View file

@ -42,7 +42,7 @@ class EditDialog(val activity: BaseSimpleActivity, val song: Song, val callback:
song.artist = newArtist
song.title = newTitle
updateContentResolver(context, song.id, newTitle, newArtist)
updateContentResolver(context, song.resolverID, newTitle, newArtist)
val oldPath = song.path
val newPath = "${oldPath.getParentPath()}/$newFilename.$newFileExtension"

View file

@ -8,7 +8,7 @@ import com.simplemobiletools.commons.helpers.SORT_BY_TITLE
import com.simplemobiletools.commons.helpers.SORT_DESCENDING
import java.io.Serializable
data class Song(val id: Long, var title: String, var artist: String, var path: String, val duration: Int, val album: String) : Serializable, Comparable<Song> {
data class Song(val resolverID: Long, var title: String, var artist: String, var path: String, val duration: Int, val album: String) : Serializable, Comparable<Song> {
companion object {
private const val serialVersionUID = 6717978793256842245L
var sorting = 0

View file

@ -500,10 +500,10 @@ class MusicService : Service(), MediaPlayer.OnPreparedListener, MediaPlayer.OnEr
mCurrSong = mSongs[Math.min(songIndex, mSongs.size - 1)]
try {
val trackUri = if (mCurrSong!!.id == 0L) {
val trackUri = if (mCurrSong!!.resolverID == 0L) {
Uri.fromFile(File(mCurrSong!!.path))
} else {
ContentUris.withAppendedId(MediaStore.Audio.Media.EXTERNAL_CONTENT_URI, mCurrSong!!.id)
ContentUris.withAppendedId(MediaStore.Audio.Media.EXTERNAL_CONTENT_URI, mCurrSong!!.resolverID)
}
mPlayer!!.setDataSource(applicationContext, trackUri)
mPlayer!!.prepareAsync()