mirror of
https://github.com/KokaKiwi/BarInsta
synced 2024-11-22 06:37:30 +00:00
Fix Caption de-serialization
This commit is contained in:
parent
841c3bdbda
commit
ce31554687
@ -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
|
||||
}
|
@ -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);
|
||||
}
|
||||
|
@ -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)) {
|
||||
|
Loading…
Reference in New Issue
Block a user