Skip to content

Commit

Permalink
chore: minor refactoring and addition of remote source for favourites
Browse files Browse the repository at this point in the history
  • Loading branch information
wax911 committed Aug 7, 2024
1 parent d6957ad commit d5cc738
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 241 deletions.
231 changes: 0 additions & 231 deletions app-data/anitrend.schema.graphql

This file was deleted.

4 changes: 1 addition & 3 deletions app-data/graphql.config.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
schema:
- anilist.schema.graphql
- anitrend.schema.graphql
schema: schema.graphql
documents: 'src/main/assets/graphql/*.graphql'
extensions:
endpoints:
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package co.anitrend.data.favourite.datasource.remote

import co.anitrend.data.core.GRAPHQL
import co.anitrend.data.core.api.model.GraphQLResponse
import io.github.wax911.library.annotation.GraphQuery
import io.github.wax911.library.model.request.QueryContainerBuilder
import retrofit2.Response
import retrofit2.http.Body
import retrofit2.http.POST

internal interface FavouriteRemoteSource {

@GRAPHQL
@POST
@GraphQuery("ToggleAnimeFavorite")
suspend fun toggleAnimeFavorite(
@Body queryContainer: QueryContainerBuilder
): Response<GraphQLResponse<Boolean>>
}
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,4 @@ internal sealed class MediaModelContainer {
@SerialName("media") val media: List<MediaModel.Core> = emptyList()
) : IPageModel
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ fun MediaCarouselItem(
) {
items(
count = carouselItems.size,
key = { carouselItems[it].id },
key = { carouselItems[it].hashCode() },
contentType = { carouselItems[it].carouselType },
) { index ->
val carouselItem = carouselItems[index]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import co.anitrend.common.media.ui.compose.item.MediaCarouselItem
import co.anitrend.core.android.ui.AniTrendPreview
import co.anitrend.core.android.ui.theme.preview.PreviewTheme
import co.anitrend.domain.carousel.entity.MediaCarousel
import co.anitrend.domain.medialist.enums.ScoreFormat
import co.anitrend.media.carousel.component.viewmodel.state.CarouselState
import co.anitrend.navigation.model.common.IParam

Expand All @@ -32,10 +33,10 @@ fun CarouselScreen(
@Composable
private fun CarouselScreenPreview() {
PreviewTheme(wrapInSurface = true) {
//MediaCarouselItem(
// carouselItems = emptyList(),
// settings = settings,
// headerSeeMoreClick = {},
//)
MediaCarouselItem(
carouselItems = emptyList(),
mediaPreferenceData = MediaPreferenceData(scoreFormat = ScoreFormat.POINT_100),
carouselItemClick = {},
)
}
}

0 comments on commit d5cc738

Please sign in to comment.