History playlist add

This commit is contained in:
Hemanth S 2020-08-21 19:49:15 +05:30
parent f013cf296d
commit b22b3a627f
46 changed files with 303 additions and 220 deletions

View file

@ -14,6 +14,7 @@
package code.name.monkey.retromusic.model
import android.os.Parcelable
import code.name.monkey.retromusic.db.HistoryEntity
import code.name.monkey.retromusic.db.SongEntity
import kotlinx.android.parcel.Parcelize
@ -33,6 +34,25 @@ open class Song(
val composer: String?,
val albumArtist: String?
) : Parcelable {
fun toHistoryEntity(timePlayed: Long): HistoryEntity {
return HistoryEntity(
id,
title,
trackNumber,
year,
duration,
data,
dateModified,
albumId,
albumName,
artistId,
artistName,
composer,
albumArtist,
timePlayed
)
}
fun toSongEntity(playListId: Int): SongEntity {
return SongEntity(
playListId,