1
0
mirror of https://github.com/KokaKiwi/BarInsta synced 2024-12-23 05:16:58 +00:00
This commit is contained in:
Austin Huang 2021-04-02 13:22:46 -04:00
parent 5c46edc949
commit 00128ad6f9
No known key found for this signature in database
GPG Key ID: 84C23AA04587A91F

View File

@ -156,12 +156,21 @@ public final class ExportImportUtils {
query,
favoriteType,
favsObject.optString("s"),
favoriteType == FavoriteType.HASHTAG ? null
: favsObject.optString("pic_url"),
favoriteType == FavoriteType.USER ? favsObject.optString("pic_url") : null,
new Date(favsObject.getLong("d")));
// 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);
}
});
}
}