we can't delegate here
This commit is contained in:
parent
3638eed220
commit
c00b5f4033
|
@ -461,7 +461,18 @@ public class DBWriter {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Future<?> addFavoriteItemById(final long itemId) {
|
public static Future<?> addFavoriteItemById(final long itemId) {
|
||||||
return addFavoriteItem(DBReader.getFeedItem(itemId));
|
return dbExec.submit(() -> {
|
||||||
|
final FeedItem item = DBReader.getFeedItem(itemId);
|
||||||
|
if (item == null) {
|
||||||
|
Log.d(TAG, "Can't find item for itemId " + itemId);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
final PodDBAdapter adapter = PodDBAdapter.getInstance().open();
|
||||||
|
adapter.addFavoriteItem(item);
|
||||||
|
adapter.close();
|
||||||
|
item.addTag(FeedItem.TAG_FAVORITE);
|
||||||
|
EventBus.getDefault().post(FavoritesEvent.added(item));
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Future<?> removeFavoriteItem(final FeedItem item) {
|
public static Future<?> removeFavoriteItem(final FeedItem item) {
|
||||||
|
|
Loading…
Reference in New Issue