Fix queue changing
This commit is contained in:
parent
69c76556a2
commit
891f1bce34
34 changed files with 1007 additions and 132 deletions
|
@ -17,30 +17,49 @@ import android.os.Parcelable
|
|||
import androidx.room.ColumnInfo
|
||||
import androidx.room.Entity
|
||||
import androidx.room.PrimaryKey
|
||||
import code.name.monkey.retromusic.BuildConfig
|
||||
import code.name.monkey.retromusic.room.SongEntity
|
||||
import code.name.monkey.retromusic.room.SongQueueEntity
|
||||
import kotlinx.android.parcel.Parcelize
|
||||
|
||||
@Parcelize
|
||||
@Entity(tableName = "playing_queue")
|
||||
|
||||
open class Song(
|
||||
@PrimaryKey val id: Int,
|
||||
@ColumnInfo(name = "title") val title: String,
|
||||
@ColumnInfo(name = "track_number") val trackNumber: Int,
|
||||
@ColumnInfo(name = "year") val year: Int,
|
||||
@ColumnInfo(name = "duration") val duration: Long,
|
||||
@ColumnInfo(name = "data") val data: String,
|
||||
@ColumnInfo(name = "date_modified") val dateModified: Long,
|
||||
@ColumnInfo(name = "album_id") val albumId: Int,
|
||||
@ColumnInfo(name = "album_name") val albumName: String,
|
||||
@ColumnInfo(name = "artist_id") val artistId: Int,
|
||||
@ColumnInfo(name = "artist_name") val artistName: String,
|
||||
@ColumnInfo(name = "composer") val composer: String?
|
||||
val id: Int,
|
||||
val title: String,
|
||||
val trackNumber: Int,
|
||||
val year: Int,
|
||||
val duration: Long,
|
||||
val data: String,
|
||||
val dateModified: Long,
|
||||
val albumId: Int,
|
||||
val albumName: String,
|
||||
val artistId: Int,
|
||||
val artistName: String,
|
||||
val composer: String?
|
||||
) : Parcelable {
|
||||
|
||||
|
||||
companion object {
|
||||
fun toSongEntity(song: Song): SongEntity {
|
||||
return SongEntity(
|
||||
fun toSongEntity(song: Song): SongQueueEntity {
|
||||
return SongQueueEntity(
|
||||
song.id,
|
||||
song.title,
|
||||
song.trackNumber,
|
||||
song.year,
|
||||
song.duration,
|
||||
song.data,
|
||||
song.dateModified,
|
||||
song.albumId,
|
||||
song.albumName,
|
||||
song.artistId,
|
||||
song.artistName,
|
||||
song.composer
|
||||
)
|
||||
}
|
||||
|
||||
fun toSongQueueEntity(song: Song): SongEntity {
|
||||
return SongEntity(
|
||||
song.id,
|
||||
song.title,
|
||||
song.trackNumber,
|
||||
|
|
|
@ -48,10 +48,8 @@ class SynchronizedLyricsLRC extends AbsSynchronizedLyrics {
|
|||
try {
|
||||
String attr = attrMatcher.group(1).toLowerCase().trim();
|
||||
String value = attrMatcher.group(2).toLowerCase().trim();
|
||||
switch (attr) {
|
||||
case "offset":
|
||||
this.offset = Integer.parseInt(value);
|
||||
break;
|
||||
if ("offset".equals(attr)) {
|
||||
this.offset = Integer.parseInt(value);
|
||||
}
|
||||
} catch (Exception ex) {
|
||||
ex.printStackTrace();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue