|
|
@@ -21,6 +21,7 @@ import com.atmob.voiceai.data.api.response.TextToSpeechResponse;
|
|
|
import com.atmob.voiceai.data.api.response.VoiceInfoResponse;
|
|
|
import com.atmob.voiceai.data.api.response.VoiceListResponse;
|
|
|
import com.atmob.voiceai.data.api.response.VoiceTypeResponse;
|
|
|
+import com.atmob.voiceai.utils.BoxingUtil;
|
|
|
import com.atmob.voiceai.utils.ToastUtil;
|
|
|
|
|
|
import java.util.ArrayList;
|
|
|
@@ -41,6 +42,7 @@ public class VoiceAIRepository {
|
|
|
|
|
|
private final AtmobApi atmobApi;
|
|
|
private final GenerateApi generateApi;
|
|
|
+ private final AccountRepository accountRepository;
|
|
|
|
|
|
private boolean textToSpeechRequest;
|
|
|
private final MutableLiveData<Integer> adFreeGenerateNumber = new MutableLiveData<>();
|
|
|
@@ -65,9 +67,10 @@ public class VoiceAIRepository {
|
|
|
}
|
|
|
|
|
|
@Inject
|
|
|
- public VoiceAIRepository(AtmobApi atmobApi, GenerateApi generateApi) {
|
|
|
+ public VoiceAIRepository(AtmobApi atmobApi, GenerateApi generateApi, AccountRepository accountRepository) {
|
|
|
this.atmobApi = atmobApi;
|
|
|
this.generateApi = generateApi;
|
|
|
+ this.accountRepository = accountRepository;
|
|
|
refreshVoiceInfo();
|
|
|
}
|
|
|
|
|
|
@@ -101,7 +104,7 @@ public class VoiceAIRepository {
|
|
|
|
|
|
|
|
|
private void refreshVoiceInfo() {
|
|
|
- if (isRequestFreeGenerate) {
|
|
|
+ if (isRequestFreeGenerate || BoxingUtil.boxing(accountRepository.getIsMember().getValue())) {
|
|
|
return;
|
|
|
}
|
|
|
requestVoiceInfo().subscribe(new SingleObserver<VoiceInfoResponse>() {
|