mirror of
https://github.com/KokaKiwi/BarInsta
synced 2024-11-22 14:47:29 +00:00
close #880
This commit is contained in:
parent
5c46edc949
commit
00128ad6f9
@ -156,12 +156,21 @@ public final class ExportImportUtils {
|
|||||||
query,
|
query,
|
||||||
favoriteType,
|
favoriteType,
|
||||||
favsObject.optString("s"),
|
favsObject.optString("s"),
|
||||||
favoriteType == FavoriteType.HASHTAG ? null
|
favoriteType == FavoriteType.USER ? favsObject.optString("pic_url") : null,
|
||||||
: favsObject.optString("pic_url"),
|
|
||||||
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))
|
final FavoriteRepository favRepo = FavoriteRepository.getInstance(FavoriteDataSource.getInstance(context));
|
||||||
.insertOrUpdateFavorite(favorite, null);
|
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…
Reference in New Issue
Block a user