From 2bcc07e95bcdf82d82a4581fd0d62aa4df2f3f9a Mon Sep 17 00:00:00 2001 From: Kurt Aaholst Date: Fri, 16 Aug 2024 16:24:29 +0200 Subject: [PATCH] Fix refresh from LMS when shopwing sub items We call clearAndReorderItems on a refresh request. The previous implementation for sub items did not order items, instead they were set on handshake complete. Now order page immediately set the (sub-)items, instead of requesting the data. --- .../ngo/squeezer/itemlist/JiveItemListActivity.java | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/Squeezer/src/main/java/uk/org/ngo/squeezer/itemlist/JiveItemListActivity.java b/Squeezer/src/main/java/uk/org/ngo/squeezer/itemlist/JiveItemListActivity.java index f5c5ebdc7..b454821dd 100644 --- a/Squeezer/src/main/java/uk/org/ngo/squeezer/itemlist/JiveItemListActivity.java +++ b/Squeezer/src/main/java/uk/org/ngo/squeezer/itemlist/JiveItemListActivity.java @@ -344,7 +344,9 @@ protected boolean needPlayer() { @Override protected void orderPage(@NonNull ISqueezeService service, int start) { if (parent != null) { - if (action == null || (parent.hasInput() && !parent.isInputReady())) { + if (parent.hasSubItems()) { + onItemsReceived(parent.subItems.size(), 0, parent.subItems, JiveItem.class); + } else if (action == null || (parent.hasInput() && !parent.isInputReady())) { showContent(); } else service.pluginItems(start, parent, action, this); @@ -353,14 +355,6 @@ protected void orderPage(@NonNull ISqueezeService service, int start) { } } - public void onEventMainThread(HandshakeComplete event) { - Log.d(TAG, "Handshake complete"); - super.onEventMainThread(event); - if (parent != null && parent.hasSubItems()) { - getItemAdapter().update(parent.subItems.size(), 0, parent.subItems); - } - } - @MainThread public void onEventMainThread(ActivePlayerChanged event) { if (action != null && !forActivePlayer(action)) {