Skip to content

Commit

Permalink
Add news fetch event log
Browse files Browse the repository at this point in the history
  • Loading branch information
michaldrabik committed Sep 25, 2023
1 parent 06ceba3 commit 703995a
Showing 1 changed file with 10 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package com.michaldrabik.data_remote.reddit.api

import com.google.firebase.analytics.ktx.analytics
import com.google.firebase.ktx.Firebase
import com.michaldrabik.data_remote.reddit.RedditRemoteDataSource
import com.michaldrabik.data_remote.reddit.model.RedditItem

Expand All @@ -14,12 +16,17 @@ internal class RedditApi(
token: String,
limit: Int,
pages: Int,
): List<RedditItem> =
listingApi.fetchTelevision(token, limit, pages).filterNot { it.is_self }
): List<RedditItem> {
Firebase.analytics.logEvent("news_fetch_television", null)
return listingApi.fetchTelevision(token, limit, pages).filterNot { it.is_self }
}

override suspend fun fetchMoviesItems(
token: String,
limit: Int,
pages: Int,
) = listingApi.fetchMovies(token, limit, pages).filterNot { it.is_self }
): List<RedditItem> {
Firebase.analytics.logEvent("news_fetch_movies", null)
return listingApi.fetchMovies(token, limit, pages).filterNot { it.is_self }
}
}

0 comments on commit 703995a

Please sign in to comment.