Skip to content

Commit

Permalink
Merge pull request #553 from Iliano101/performance
Browse files Browse the repository at this point in the history
Small performance improvements
  • Loading branch information
maxrave-dev authored Nov 28, 2024
2 parents a92c926 + 65b15bb commit b0a0ce4
Show file tree
Hide file tree
Showing 31 changed files with 325 additions and 239 deletions.
11 changes: 10 additions & 1 deletion app/proguard-rules.pro
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,13 @@
-keep class com.maxrave.simpmusic.data.model.** { *; }
-keep class com.maxrave.simpmusic.extension.AllExtKt { *; }
-keep class com.maxrave.simpmusic.extension.AllExtKt$* { *; }
-keep class com.maxrave.kotlinytmusicscraper.extension.MapExtKt$* { *; }
-keep class com.maxrave.kotlinytmusicscraper.extension.MapExtKt$* { *; }

# Removes all Logs as they cause perfomance issues in prod
-assumenosideeffects class android.util.Log {
public static int w(...);
public static int e(...);
public static int i(...);
public static int d(...);
public static int v(...);
}
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
package com.maxrave.simpmusic.data.model.browse.album


import androidx.compose.runtime.Immutable
import com.google.gson.annotations.SerializedName
import com.maxrave.simpmusic.data.model.searchResult.songs.Artist
import com.maxrave.simpmusic.data.model.searchResult.songs.Thumbnail

@Immutable
data class AlbumBrowse(
@SerializedName("artists")
val artists: List<Artist>,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
package com.maxrave.simpmusic.data.model.browse.album


import androidx.compose.runtime.Immutable
import com.google.gson.annotations.SerializedName
import com.maxrave.simpmusic.data.model.searchResult.songs.Album
import com.maxrave.simpmusic.data.model.searchResult.songs.Artist
import com.maxrave.simpmusic.data.model.searchResult.songs.FeedbackTokens
import com.maxrave.simpmusic.data.model.searchResult.songs.Thumbnail

@Immutable
data class Track(
@SerializedName("album")
val album: Album?,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
package com.maxrave.simpmusic.data.model.browse.playlist


import androidx.compose.runtime.Immutable
import com.google.gson.annotations.SerializedName

@Immutable
data class AlbumPlaylist(
@SerializedName("id")
val id: Any,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
package com.maxrave.simpmusic.data.model.browse.playlist


import androidx.compose.runtime.Immutable
import com.google.gson.annotations.SerializedName

@Immutable
data class Author(
@SerializedName("id")
val id: String,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
package com.maxrave.simpmusic.data.model.browse.playlist


import androidx.compose.runtime.Immutable
import com.google.gson.annotations.SerializedName
import com.maxrave.simpmusic.data.model.browse.album.Track
import com.maxrave.simpmusic.data.model.searchResult.songs.Thumbnail

@Immutable
data class PlaylistBrowse(
@SerializedName("author")
val author: Author,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
package com.maxrave.simpmusic.data.model.browse.playlist


import androidx.compose.runtime.Immutable
import com.google.gson.annotations.SerializedName
import com.maxrave.simpmusic.data.model.searchResult.songs.Artist
import com.maxrave.simpmusic.data.model.searchResult.songs.Thumbnail

@Immutable
data class TrackPlaylist(
@SerializedName("album")
val albumPlaylist: AlbumPlaylist,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
package com.maxrave.simpmusic.data.model.explore.mood


import androidx.compose.runtime.Immutable
import com.google.gson.annotations.SerializedName

@Immutable
data class Genre(
@SerializedName("params")
val params: String,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
package com.maxrave.simpmusic.data.model.explore.mood


import androidx.compose.runtime.Immutable
import com.google.gson.annotations.SerializedName

@Immutable
data class Mood(
@SerializedName(value = "Genres", alternate = ["Thể loại", "Gatunki", "Per te"])
val genres: ArrayList<Genre>,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
package com.maxrave.simpmusic.data.model.explore.mood


import androidx.compose.runtime.Immutable
import com.google.gson.annotations.SerializedName

@Immutable
data class MoodsMoment(
@SerializedName("params")
val params: String,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
package com.maxrave.simpmusic.data.model.explore.mood.genre


import androidx.compose.runtime.Immutable
import com.google.gson.annotations.SerializedName
import com.maxrave.simpmusic.data.model.searchResult.songs.Thumbnail
import com.maxrave.simpmusic.data.type.HomeContentType

@Immutable
data class Content(
@SerializedName("playlistBrowseId")
val playlistBrowseId: String,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
package com.maxrave.simpmusic.data.model.explore.mood.genre


import androidx.compose.runtime.Immutable
import com.google.gson.annotations.SerializedName

@Immutable
data class GenreObject(
@SerializedName("header")
val header: String,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
package com.maxrave.simpmusic.data.model.explore.mood.genre


import androidx.compose.runtime.Immutable
import com.google.gson.annotations.SerializedName

@Immutable
data class ItemsPlaylist(
@SerializedName("contents")
val contents: List<Content>,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
package com.maxrave.simpmusic.data.model.explore.mood.genre

import androidx.compose.runtime.Immutable
import com.maxrave.simpmusic.data.model.searchResult.songs.Artist

@Immutable
data class ItemsSong(
val title: String,
val artist: List<Artist>?,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
package com.maxrave.simpmusic.data.model.explore.mood.genre


import androidx.compose.runtime.Immutable
import com.google.gson.annotations.SerializedName

@Immutable
data class Title(
@SerializedName("subtitle")
val subtitle: String,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
package com.maxrave.simpmusic.data.model.explore.mood.moodmoments


import androidx.compose.runtime.Immutable
import com.google.gson.annotations.SerializedName
import com.maxrave.simpmusic.data.model.searchResult.songs.Thumbnail
import com.maxrave.simpmusic.data.type.HomeContentType

@Immutable
data class Content(
@SerializedName("playlistBrowseId")
val playlistBrowseId: String,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
package com.maxrave.simpmusic.data.model.explore.mood.moodmoments


import androidx.compose.runtime.Immutable
import com.google.gson.annotations.SerializedName

@Immutable
data class Item(
@SerializedName("contents")
val contents: List<Content>,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
package com.maxrave.simpmusic.data.model.explore.mood.moodmoments


import androidx.compose.runtime.Immutable
import com.google.gson.annotations.SerializedName

@Immutable
data class MoodsMomentObject(
@SerializedName("endpoint")
val endpoint: String,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
package com.maxrave.simpmusic.data.model.home


import androidx.compose.runtime.Immutable
import com.google.gson.annotations.SerializedName
import com.maxrave.simpmusic.data.model.searchResult.songs.Album
import com.maxrave.simpmusic.data.model.searchResult.songs.Artist
import com.maxrave.simpmusic.data.model.searchResult.songs.Thumbnail
import com.maxrave.simpmusic.data.type.HomeContentType

@Immutable
data class Content(
@SerializedName("album")
val album: Album?,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
package com.maxrave.simpmusic.data.model.home

import androidx.compose.runtime.Immutable
import com.maxrave.simpmusic.data.model.explore.mood.Mood
import com.maxrave.simpmusic.data.model.home.chart.Chart
import com.maxrave.simpmusic.utils.Resource

@Immutable
data class HomeDataCombine(
val home: Resource<ArrayList<HomeItem>>,
val mood: Resource<Mood>,
val chart: Resource<Chart>,
val newRelease: Resource<ArrayList<HomeItem>>,
) {
}
)
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
package com.maxrave.simpmusic.data.model.home


import androidx.compose.runtime.Immutable
import com.google.gson.annotations.SerializedName
import com.maxrave.simpmusic.data.model.searchResult.songs.Thumbnail

@Immutable
data class HomeItem(
@SerializedName("contents")
val contents: List<Content?>,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
package com.maxrave.simpmusic.data.model.home

import androidx.compose.runtime.Immutable
import com.maxrave.simpmusic.data.model.explore.mood.Mood
import com.maxrave.simpmusic.data.model.home.chart.Chart
import com.maxrave.simpmusic.utils.Resource


@Immutable
data class HomeResponse(
val homeItem: Resource<ArrayList<HomeItem>>,
val exploreMood: Resource<Mood>,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
package com.maxrave.simpmusic.data.model.home.chart


import androidx.compose.runtime.Immutable
import com.google.gson.annotations.SerializedName


@Immutable
data class Artists(
@SerializedName("items")
val itemArtists: ArrayList<ItemArtist>,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
package com.maxrave.simpmusic.data.model.home.chart


import androidx.compose.runtime.Immutable
import com.google.gson.annotations.SerializedName
import com.maxrave.simpmusic.data.model.browse.album.Track

@Immutable
data class Chart(
@SerializedName("artists")
val artists: Artists,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
package com.maxrave.simpmusic.data.model.home.chart


import androidx.compose.runtime.Immutable
import com.google.gson.annotations.SerializedName

@Immutable
data class Countries(
@SerializedName("options")
val options: List<String>,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
package com.maxrave.simpmusic.data.model.home.chart


import androidx.compose.runtime.Immutable
import com.google.gson.annotations.SerializedName
import com.maxrave.simpmusic.data.model.searchResult.songs.Thumbnail

@Immutable
data class ItemArtist(
@SerializedName("browseId")
val browseId: String,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
package com.maxrave.simpmusic.data.model.home.chart


import androidx.compose.runtime.Immutable
import com.google.gson.annotations.SerializedName
import com.maxrave.simpmusic.data.model.browse.album.Track
import com.maxrave.simpmusic.data.model.searchResult.songs.Artist
import com.maxrave.simpmusic.data.model.searchResult.songs.Thumbnail

@Immutable
data class ItemVideo(
@SerializedName("artists")
val artists: List<Artist>?,
Expand All @@ -20,6 +22,7 @@ data class ItemVideo(
@SerializedName("views")
val views: String
)

fun ItemVideo.toTrack(): Track {
return Track(
album = null,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
package com.maxrave.simpmusic.data.model.home.chart


import androidx.compose.runtime.Immutable
import com.google.gson.annotations.SerializedName

@Immutable
data class Selected(
@SerializedName("text")
val text: String
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
package com.maxrave.simpmusic.data.model.home.chart


import androidx.compose.runtime.Immutable
import com.google.gson.annotations.SerializedName

@Immutable
data class Videos(
@SerializedName("items")
val items: ArrayList<ItemVideo>,
Expand Down
Loading

0 comments on commit b0a0ce4

Please sign in to comment.