Commit de24ae06 authored by Geoffrey Métais's avatar Geoffrey Métais

Fix audio 'play all' ctx menu option

parent 5f6f6de6
......@@ -155,17 +155,6 @@ public class AudioBrowserAdapter extends PagedListAdapter<MediaLibraryItem, Audi
return currentList == null || currentList.isEmpty();
}
int getListWithPosition(List<MediaLibraryItem> list, int position) {
int offset = 0, count = getItemCount();
for (int i = 0; i < count; ++i)
if (getItem(i).getItemType() == MediaLibraryItem.TYPE_DUMMY) {
if (i < position)
++offset;
} else
list.add(getItem(i));
return position-offset;
}
@Override
public long getItemId(int position) {
return isPositionValid(position) ? getItem(position).getId() : -1;
......
......@@ -198,9 +198,7 @@ public abstract class BaseAudioBrowser extends MediaBrowserFragment<MLPagedModel
MediaUtils.INSTANCE.openArray(requireActivity(), media.getTracks(), 0);
break;
case Constants.CTX_PLAY_ALL:
final List<MediaLibraryItem> mediaList = new ArrayList<>();
final int startPosition = adapter.getListWithPosition(mediaList, position);
MediaUtils.INSTANCE.openList(requireActivity(), (List<MediaWrapper>)(List<?>) mediaList, startPosition);
MediaUtils.INSTANCE.openArray(requireActivity(), (MediaWrapper[]) getViewModel().getAll(), position);
break;
case Constants.CTX_INFORMATION:
showInfoDialog(media);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment