Tweak code
This commit is contained in:
@@ -14,4 +14,4 @@ data class Artist(
|
||||
val radioVideoId: String? = null,
|
||||
val radioPlaylistId: String? = null,
|
||||
val timestamp: Long?
|
||||
)
|
||||
)
|
||||
|
||||
@@ -4,7 +4,6 @@ import androidx.room.Embedded
|
||||
import androidx.room.Junction
|
||||
import androidx.room.Relation
|
||||
|
||||
|
||||
open class DetailedSong(
|
||||
@Embedded val song: Song,
|
||||
@Relation(
|
||||
|
||||
@@ -2,7 +2,6 @@ package it.vfsfitvnm.vimusic.models
|
||||
|
||||
import androidx.room.Relation
|
||||
|
||||
|
||||
class DetailedSongWithContentLength(
|
||||
song: Song,
|
||||
albumId: String?,
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
package it.vfsfitvnm.vimusic.models
|
||||
|
||||
import androidx.compose.runtime.Immutable
|
||||
import androidx.room.*
|
||||
|
||||
import androidx.room.Entity
|
||||
import androidx.room.ForeignKey
|
||||
import androidx.room.PrimaryKey
|
||||
|
||||
@Immutable
|
||||
@Entity(
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
package it.vfsfitvnm.vimusic.models
|
||||
|
||||
import androidx.room.*
|
||||
|
||||
import androidx.room.Embedded
|
||||
import androidx.room.Junction
|
||||
import androidx.room.Relation
|
||||
|
||||
data class PlaylistWithSongs(
|
||||
@Embedded val playlist: Playlist,
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
package it.vfsfitvnm.vimusic.models
|
||||
|
||||
|
||||
import androidx.media3.common.MediaItem
|
||||
import androidx.room.ColumnInfo
|
||||
import androidx.room.Entity
|
||||
@@ -11,4 +10,4 @@ class QueuedMediaItem(
|
||||
@PrimaryKey(autoGenerate = true) val id: Long = 0,
|
||||
@ColumnInfo(typeAffinity = ColumnInfo.BLOB) val mediaItem: MediaItem,
|
||||
var position: Long?
|
||||
)
|
||||
)
|
||||
|
||||
@@ -5,7 +5,6 @@ import androidx.room.Entity
|
||||
import androidx.room.Index
|
||||
import androidx.room.PrimaryKey
|
||||
|
||||
|
||||
@Immutable
|
||||
@Entity(
|
||||
indices = [
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package it.vfsfitvnm.vimusic.models
|
||||
|
||||
import androidx.room.*
|
||||
|
||||
import androidx.room.Entity
|
||||
import androidx.room.PrimaryKey
|
||||
|
||||
@Entity
|
||||
data class Song(
|
||||
@@ -20,7 +20,7 @@ data class Song(
|
||||
|
||||
val hours = seconds / 3600
|
||||
|
||||
return when {
|
||||
return when {
|
||||
hours == 0L -> "${seconds / 60}m"
|
||||
hours < 24L -> "${hours}h"
|
||||
else -> "${hours / 24}d"
|
||||
|
||||
@@ -5,7 +5,6 @@ import androidx.room.ColumnInfo
|
||||
import androidx.room.Entity
|
||||
import androidx.room.ForeignKey
|
||||
|
||||
|
||||
@Immutable
|
||||
@Entity(
|
||||
primaryKeys = ["songId", "albumId"],
|
||||
|
||||
@@ -4,7 +4,6 @@ import androidx.room.ColumnInfo
|
||||
import androidx.room.Entity
|
||||
import androidx.room.ForeignKey
|
||||
|
||||
|
||||
@Entity(
|
||||
primaryKeys = ["songId", "artistId"],
|
||||
foreignKeys = [
|
||||
@@ -25,4 +24,4 @@ import androidx.room.ForeignKey
|
||||
data class SongArtistMap(
|
||||
@ColumnInfo(index = true) val songId: String,
|
||||
@ColumnInfo(index = true) val artistId: String
|
||||
)
|
||||
)
|
||||
|
||||
@@ -1,12 +1,9 @@
|
||||
package it.vfsfitvnm.vimusic.models
|
||||
|
||||
import androidx.compose.runtime.Immutable
|
||||
import androidx.room.ColumnInfo
|
||||
import androidx.room.Entity
|
||||
import androidx.room.ForeignKey
|
||||
|
||||
|
||||
@Immutable
|
||||
@Entity(
|
||||
primaryKeys = ["songId", "playlistId"],
|
||||
foreignKeys = [
|
||||
|
||||
Reference in New Issue
Block a user