|
|
@ -34,7 +34,7 @@ class TracksSearchRepository(override val context: Context?, var query: String) |
|
|
|
|
|
|
|
|
|
|
|
override fun cache(data: List<Track>) = TracksCache(data) |
|
|
|
override fun cache(data: List<Track>) = TracksCache(data) |
|
|
|
override fun uncache(json: String) = |
|
|
|
override fun uncache(json: String) = |
|
|
|
gsonDeserializerOf(TracksCache::class.java).deserialize(json) |
|
|
|
gsonDeserializerOf(TracksCache::class.java).deserialize(json.reader()) |
|
|
|
|
|
|
|
|
|
|
|
override fun onDataFetched(data: List<Track>): List<Track> = runBlocking { |
|
|
|
override fun onDataFetched(data: List<Track>): List<Track> = runBlocking { |
|
|
|
val favorites = FavoritedRepository(context).fetch(Origin.Cache.origin) |
|
|
|
val favorites = FavoritedRepository(context).fetch(Origin.Cache.origin) |
|
|
@ -76,7 +76,7 @@ class ArtistsSearchRepository(override val context: Context?, var query: String) |
|
|
|
|
|
|
|
|
|
|
|
override fun cache(data: List<Artist>) = ArtistsCache(data) |
|
|
|
override fun cache(data: List<Artist>) = ArtistsCache(data) |
|
|
|
override fun uncache(json: String) = |
|
|
|
override fun uncache(json: String) = |
|
|
|
gsonDeserializerOf(ArtistsCache::class.java).deserialize(json) |
|
|
|
gsonDeserializerOf(ArtistsCache::class.java).deserialize(json.reader()) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
class AlbumsSearchRepository(override val context: Context?, var query: String) : |
|
|
|
class AlbumsSearchRepository(override val context: Context?, var query: String) : |
|
|
@ -96,5 +96,5 @@ class AlbumsSearchRepository(override val context: Context?, var query: String) |
|
|
|
|
|
|
|
|
|
|
|
override fun cache(data: List<Album>) = AlbumsCache(data) |
|
|
|
override fun cache(data: List<Album>) = AlbumsCache(data) |
|
|
|
override fun uncache(json: String) = |
|
|
|
override fun uncache(json: String) = |
|
|
|
gsonDeserializerOf(AlbumsCache::class.java).deserialize(json) |
|
|
|
gsonDeserializerOf(AlbumsCache::class.java).deserialize(json.reader()) |
|
|
|
} |
|
|
|
} |
|
|
|