mirror of
https://github.com/jellyfin/jellyfin-androidtv.git
synced 2024-11-27 08:00:28 +00:00
Improve behavior when no playable items found
This commit is contained in:
parent
1199fa5253
commit
1f789ac00f
@ -1186,6 +1186,10 @@ public class FullDetailsFragment extends Fragment implements RecordingIndicatorV
|
||||
@Override
|
||||
public void onResponse(List<BaseItemDto> response) {
|
||||
if (!getActive()) return;
|
||||
if (response.isEmpty()) {
|
||||
Timber.e("No items to play - ignoring play request.");
|
||||
return;
|
||||
}
|
||||
|
||||
if (item.getType() == BaseItemKind.MUSIC_ARTIST) {
|
||||
mediaManager.getValue().playNow(requireContext(), response, 0, shuffle);
|
||||
@ -1196,7 +1200,6 @@ public class FullDetailsFragment extends Fragment implements RecordingIndicatorV
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
void play(final List<BaseItemDto> items, final int pos, final boolean shuffle) {
|
||||
|
@ -55,7 +55,9 @@ class SdkPlaybackHelper(
|
||||
) {
|
||||
getScope(context).launch {
|
||||
runCatching {
|
||||
getItems(mainItem, allowIntros, shuffle)
|
||||
val items = getItems(mainItem, allowIntros, shuffle)
|
||||
if (items.isEmpty() && !mainItem.mediaSources.isNullOrEmpty()) listOf(mainItem)
|
||||
else items
|
||||
}.fold(
|
||||
onSuccess = { items -> outerResponse.onResponse(items) },
|
||||
onFailure = { exception ->
|
||||
|
Loading…
Reference in New Issue
Block a user