Browse Source

close #880

renovate/org.robolectric-robolectric-4.x
Austin Huang 4 years ago
parent
commit
00128ad6f9
No known key found for this signature in database GPG Key ID: 84C23AA04587A91F
  1. 17
      app/src/main/java/awais/instagrabber/utils/ExportImportUtils.java

17
app/src/main/java/awais/instagrabber/utils/ExportImportUtils.java

@ -156,12 +156,21 @@ public final class ExportImportUtils {
query, query,
favoriteType, favoriteType,
favsObject.optString("s"), favsObject.optString("s"),
favoriteType == FavoriteType.HASHTAG ? null
: favsObject.optString("pic_url"),
favoriteType == FavoriteType.USER ? favsObject.optString("pic_url") : null,
new Date(favsObject.getLong("d"))); new Date(favsObject.getLong("d")));
// Log.d(TAG, "importJson: favoriteModel: " + favoriteModel); // Log.d(TAG, "importJson: favoriteModel: " + favoriteModel);
FavoriteRepository.getInstance(FavoriteDataSource.getInstance(context))
.insertOrUpdateFavorite(favorite, null);
final FavoriteRepository favRepo = FavoriteRepository.getInstance(FavoriteDataSource.getInstance(context));
favRepo.getFavorite(query, favoriteType, new RepositoryCallback<Favorite>() {
@Override
public void onSuccess(final Favorite result) {
// local has priority since it's more frequently updated
}
@Override
public void onDataNotAvailable() {
favRepo.insertOrUpdateFavorite(favorite, null);
}
});
} }
} }

Loading…
Cancel
Save