Skip to content

Commit

Permalink
Improve thumbnails size in Radio Playlist
Browse files Browse the repository at this point in the history
  • Loading branch information
maxrave-dev committed Jan 19, 2024
1 parent fa90943 commit a51ab49
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion app/src/main/java/com/maxrave/simpmusic/extension/AllExt.kt
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,15 @@ fun Track.toSongEntity(): SongEntity {
isAvailable = this.isAvailable,
isExplicit = this.isExplicit,
likeStatus = this.likeStatus ?: "",
thumbnails = this.thumbnails?.last()?.url,
thumbnails = this.thumbnails?.last()?.url?.let {
if (it.contains("w120")) {
return@let Regex("([wh])120").replace(it, "$1544")
} else if (it.contains("sddefault")) {
return@let it.replace("sddefault", "maxresdefault")
} else {
return@let it
}
},
title = this.title,
videoType = this.videoType ?: "",
category = this.category,
Expand Down

0 comments on commit a51ab49

Please sign in to comment.