mirror of
https://github.com/antebudimir/tempus.git
synced 2026-01-02 02:13:33 +00:00
- Removed middle layer of abstraction for subsonic classes
- Used kotlin for classes
This commit is contained in:
parent
917c0839de
commit
ca15f51c85
168 changed files with 2026 additions and 6588 deletions
|
|
@ -2,62 +2,11 @@ package com.cappielloantonio.play.model
|
|||
|
||||
import android.os.Parcelable
|
||||
import androidx.annotation.Keep
|
||||
import com.cappielloantonio.play.subsonic.models.AlbumID3
|
||||
import com.cappielloantonio.play.subsonic.models.AlbumWithSongsID3
|
||||
import com.cappielloantonio.play.util.MappingUtil
|
||||
import kotlinx.android.parcel.Parcelize
|
||||
import java.util.*
|
||||
|
||||
@Keep
|
||||
@Parcelize
|
||||
class Album(
|
||||
var id: String,
|
||||
val title: String,
|
||||
val year: Int? = 0,
|
||||
val artistId: String,
|
||||
val artistName: String,
|
||||
val primary: String,
|
||||
var starred: Boolean?,
|
||||
val songs: List<Media>?,
|
||||
val created: Date?
|
||||
) : Parcelable {
|
||||
|
||||
constructor(albumID3: AlbumID3) : this(
|
||||
albumID3.id,
|
||||
albumID3.name,
|
||||
albumID3.year ?: 0,
|
||||
albumID3.artistId,
|
||||
albumID3.artist,
|
||||
albumID3.coverArtId,
|
||||
albumID3.starred != null,
|
||||
null,
|
||||
albumID3.created
|
||||
)
|
||||
|
||||
constructor(albumWithSongsID3: AlbumWithSongsID3) : this(
|
||||
albumWithSongsID3.id,
|
||||
albumWithSongsID3.name,
|
||||
albumWithSongsID3.year ?: 0,
|
||||
albumWithSongsID3.artistId,
|
||||
albumWithSongsID3.artist,
|
||||
albumWithSongsID3.coverArtId,
|
||||
albumWithSongsID3.starred != null,
|
||||
MappingUtil.mapSong(albumWithSongsID3.songs),
|
||||
albumWithSongsID3.created
|
||||
)
|
||||
|
||||
constructor(download: Download) : this(
|
||||
download.albumId,
|
||||
download.albumName,
|
||||
0,
|
||||
download.artistId,
|
||||
download.artistName,
|
||||
download.primary,
|
||||
null,
|
||||
null,
|
||||
null
|
||||
)
|
||||
|
||||
class Album : Parcelable {
|
||||
companion object {
|
||||
const val RECENTLY_PLAYED = "RECENTLY_PLAYED"
|
||||
const val MOST_PLAYED = "MOST_PLAYED"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue