From 5ce6859837402e05711e5ad28a546163101b7931 Mon Sep 17 00:00:00 2001 From: Austin Huang Date: Sat, 24 Jul 2021 19:30:24 -0400 Subject: [PATCH] random cleanup --- .../java/awais/instagrabber/webservices/GraphQLRepository.kt | 3 +-- .../java/awais/instagrabber/webservices/MediaRepository.kt | 2 +- .../java/awais/instagrabber/webservices/ProfileRepository.kt | 4 ++-- .../java/awais/instagrabber/webservices/SearchRepository.kt | 2 +- 4 files changed, 5 insertions(+), 6 deletions(-) diff --git a/app/src/main/java/awais/instagrabber/webservices/GraphQLRepository.kt b/app/src/main/java/awais/instagrabber/webservices/GraphQLRepository.kt index 509477ae..ba1250e9 100644 --- a/app/src/main/java/awais/instagrabber/webservices/GraphQLRepository.kt +++ b/app/src/main/java/awais/instagrabber/webservices/GraphQLRepository.kt @@ -1,7 +1,6 @@ package awais.instagrabber.webservices import android.util.Log -import awais.instagrabber.models.enums.FollowingType import awais.instagrabber.repositories.GraphQLService import awais.instagrabber.repositories.responses.* import awais.instagrabber.utils.Constants @@ -299,7 +298,7 @@ open class GraphQLRepository(private val service: GraphQLService) { fun getInstance(): GraphQLRepository { return INSTANCE ?: synchronized(this) { - val service: GraphQLService = RetrofitFactory.retrofitWeb.create(GraphQLService::class.java) + val service = RetrofitFactory.retrofitWeb.create(GraphQLService::class.java) GraphQLRepository(service).also { INSTANCE = it } } } diff --git a/app/src/main/java/awais/instagrabber/webservices/MediaRepository.kt b/app/src/main/java/awais/instagrabber/webservices/MediaRepository.kt index c2762b9a..794c094a 100644 --- a/app/src/main/java/awais/instagrabber/webservices/MediaRepository.kt +++ b/app/src/main/java/awais/instagrabber/webservices/MediaRepository.kt @@ -189,7 +189,7 @@ class MediaRepository(private val service: MediaService) { fun getInstance(): MediaRepository { return INSTANCE ?: synchronized(this) { - val service: MediaService = retrofit.create(MediaService::class.java) + val service = retrofit.create(MediaService::class.java) MediaRepository(service).also { INSTANCE = it } } } diff --git a/app/src/main/java/awais/instagrabber/webservices/ProfileRepository.kt b/app/src/main/java/awais/instagrabber/webservices/ProfileRepository.kt index ea3558f1..42d0a58f 100644 --- a/app/src/main/java/awais/instagrabber/webservices/ProfileRepository.kt +++ b/app/src/main/java/awais/instagrabber/webservices/ProfileRepository.kt @@ -10,7 +10,7 @@ import com.google.common.collect.ImmutableMap import java.util.* import java.util.stream.Collectors -class ProfileRepository private constructor(private val repository: ProfileService) { +open class ProfileRepository(private val repository: ProfileService) { suspend fun fetchPosts( userId: Long, maxId: String? @@ -113,7 +113,7 @@ class ProfileRepository private constructor(private val repository: ProfileServi fun getInstance(): ProfileRepository { return INSTANCE ?: synchronized(this) { - val service: ProfileService = RetrofitFactory.retrofit.create(ProfileService::class.java) + val service = RetrofitFactory.retrofit.create(ProfileService::class.java) ProfileRepository(service).also { INSTANCE = it } } } diff --git a/app/src/main/java/awais/instagrabber/webservices/SearchRepository.kt b/app/src/main/java/awais/instagrabber/webservices/SearchRepository.kt index 53be0065..8b744130 100644 --- a/app/src/main/java/awais/instagrabber/webservices/SearchRepository.kt +++ b/app/src/main/java/awais/instagrabber/webservices/SearchRepository.kt @@ -6,7 +6,7 @@ import awais.instagrabber.webservices.RetrofitFactory.retrofitWeb import com.google.common.collect.ImmutableMap import retrofit2.Call -class SearchRepository(private val service: SearchService) { +open class SearchRepository(private val service: SearchService) { suspend fun search( isLoggedIn: Boolean, query: String,