1
0
mirror of https://github.com/KokaKiwi/BarInsta synced 2024-11-22 22:57:29 +00:00

remove feed timeout due to complaints

This commit is contained in:
Austin Huang 2020-12-25 11:21:44 -05:00
parent e539e426df
commit c40a0033db
No known key found for this signature in database
GPG Key ID: 84C23AA04587A91F
2 changed files with 7 additions and 8 deletions

View File

@ -1,7 +1,7 @@
package awais.instagrabber.asyncs; package awais.instagrabber.asyncs;
import android.os.Handler; //import android.os.Handler;
import android.util.Log; //import android.util.Log;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
@ -21,13 +21,13 @@ public class FeedPostFetchService implements PostFetcher.PostFetchService {
private static final String TAG = "FeedPostFetchService"; private static final String TAG = "FeedPostFetchService";
private final FeedService feedService; private final FeedService feedService;
private String nextCursor; private String nextCursor;
private final Handler handler; // private final Handler handler;
private boolean hasNextPage; private boolean hasNextPage;
private static final int DELAY_MILLIS = 500; // private static final int DELAY_MILLIS = 500;
public FeedPostFetchService() { public FeedPostFetchService() {
feedService = FeedService.getInstance(); feedService = FeedService.getInstance();
handler = new Handler(); // handler = new Handler();
} }
@Override @Override
@ -49,9 +49,9 @@ public class FeedPostFetchService implements PostFetcher.PostFetchService {
feedModels.addAll(result.getFeedModels()); feedModels.addAll(result.getFeedModels());
if (fetchListener != null) { if (fetchListener != null) {
if (feedModels.size() < 15 && hasNextPage) { if (feedModels.size() < 15 && hasNextPage) {
handler.postDelayed(() -> { // handler.postDelayed(() -> {
feedService.fetch(csrfToken, nextCursor, this); feedService.fetch(csrfToken, nextCursor, this);
}, DELAY_MILLIS); // }, DELAY_MILLIS);
} }
else { else {
fetchListener.onResult(feedModels); fetchListener.onResult(feedModels);

View File

@ -91,7 +91,6 @@ public class StoriesService extends BaseService {
private void parseStoriesBody(final String body, final ServiceCallback<List<FeedStoryModel>> callback) { private void parseStoriesBody(final String body, final ServiceCallback<List<FeedStoryModel>> callback) {
try { try {
Log.d("austin_debug", body);
final List<FeedStoryModel> feedStoryModels = new ArrayList<>(); final List<FeedStoryModel> feedStoryModels = new ArrayList<>();
final JSONArray feedStoriesReel = new JSONObject(body).getJSONArray("tray"); final JSONArray feedStoriesReel = new JSONObject(body).getJSONArray("tray");
for (int i = 0; i < feedStoriesReel.length(); ++i) { for (int i = 0; i < feedStoriesReel.length(); ++i) {