1
0
mirror of https://github.com/KokaKiwi/BarInsta synced 2024-12-23 05:16:58 +00:00

Fix Caption de-serialization

This commit is contained in:
Ammar Githam 2021-05-25 02:08:46 +09:00
parent 841c3bdbda
commit ce31554687
3 changed files with 7 additions and 4 deletions

View File

@ -2,6 +2,9 @@ package awais.instagrabber.repositories.responses
import java.io.Serializable
data class Caption(val userId: Long, var text: String?) : Serializable {
var pk: Long = 0
data class Caption(
val userId: Long = 0,
var text: String? = null,
) : Serializable {
var pk: String? = null
}

View File

@ -30,7 +30,7 @@ public class CaptionDeserializer implements JsonDeserializer<Caption> {
pkString = pkString.substring(0, pkString.indexOf("_"));
}
try {
caption.setPk(Long.parseLong(pkString));
caption.setPk(pkString);
} catch (NumberFormatException e) {
Log.e(TAG, "deserialize: ", e);
}

View File

@ -272,7 +272,7 @@ public class PostViewV2ViewModel extends ViewModel {
data.postValue(Resource.loading(null));
final Caption value = caption.getValue();
if (value == null) return data;
mediaService.translate(String.valueOf(value.getPk()), "1", new ServiceCallback<String>() {
mediaService.translate(value.getPk(), "1", new ServiceCallback<String>() {
@Override
public void onSuccess(final String result) {
if (TextUtils.isEmpty(result)) {