mirror of
https://github.com/Shabinder/SpotiFlyer.git
synced 2024-11-25 02:14:32 +01:00
Gaana Response Null Issue Fix
This commit is contained in:
parent
d97536ee50
commit
e62abca957
@ -23,19 +23,19 @@ import com.squareup.moshi.Json
|
||||
data class GaanaTrack (
|
||||
val tags : List<Tags?>?,
|
||||
val seokey : String,
|
||||
val albumseokey : String,
|
||||
val albumseokey : String?,
|
||||
val track_title : String,
|
||||
val album_title : String,
|
||||
val language : String,
|
||||
val album_title : String?,
|
||||
val language : String?,
|
||||
val duration: Int,
|
||||
@Json(name = "artwork_large") val artworkLink : String,
|
||||
val artist : List<Artist>,
|
||||
@Json(name = "gener") val genre : List<Genre>,
|
||||
val lyrics_url : String,
|
||||
val youtube_id : String,
|
||||
val total_favourite_count : Int,
|
||||
val release_date : String,
|
||||
val play_ct : String,
|
||||
val artist : List<Artist?>,
|
||||
@Json(name = "gener") val genre : List<Genre?>?,
|
||||
val lyrics_url : String?,
|
||||
val youtube_id : String?,
|
||||
val total_favourite_count : Int?,
|
||||
val release_date : String?,
|
||||
val play_ct : String?,
|
||||
val secondary_language : String?,
|
||||
var downloaded: DownloadStatus? = DownloadStatus.NotDownloaded
|
||||
)
|
@ -159,14 +159,14 @@ class GaanaViewModel @ViewModelInject constructor(val databaseDAO: DatabaseDAO)
|
||||
private fun List<GaanaTrack>.toTrackDetailsList() = this.map {
|
||||
TrackDetails(
|
||||
title = it.track_title,
|
||||
artists = it.artist.map { artist -> artist.name },
|
||||
artists = it.artist.map { artist -> artist?.name.toString() },
|
||||
durationSec = it.duration,
|
||||
albumArt = File(
|
||||
Environment.getExternalStorageDirectory(),
|
||||
Provider.defaultDir +".Images/" + (it.artworkLink.substringBeforeLast('/').substringAfterLast('/')) + ".jpeg"),
|
||||
albumName = it.album_title,
|
||||
year = it.release_date,
|
||||
comment = "Genres:${it.genre.map { genre -> genre.name }.reduceOrNull { acc, s -> acc + s }}",
|
||||
comment = "Genres:${it.genre?.map { genre -> genre?.name }?.reduceOrNull { acc, s -> acc + s }}",
|
||||
trackUrl = it.lyrics_url,
|
||||
downloaded = it.downloaded ?: DownloadStatus.NotDownloaded,
|
||||
source = Source.Gaana,
|
||||
|
Loading…
Reference in New Issue
Block a user