Austin Huang
4 years ago
No known key found for this signature in database
GPG Key ID: 84C23AA04587A91F
1 changed files with
13 additions and
4 deletions
-
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); |
|
|
|
|
|
} |
|
|
|
|
|
}); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|