mirror of
https://github.com/tapframe/NuvioStreaming.git
synced 2026-01-11 20:10:25 +00:00
Implement stream filtering by selected provider in StreamsScreen; enhance user experience by allowing users to view streams from specific providers instead of all available options.
This commit is contained in:
parent
f96d1f1af3
commit
b12f41d0ae
1 changed files with 12 additions and 1 deletions
|
|
@ -559,7 +559,16 @@ export const StreamsScreen = () => {
|
|||
const streams = type === 'series' ? episodeStreams : groupedStreams;
|
||||
const installedAddons = stremioService.getInstalledAddons();
|
||||
|
||||
return Object.entries(streams)
|
||||
// Filter streams by selected provider - only if not "all"
|
||||
const filteredEntries = Object.entries(streams)
|
||||
.filter(([addonId]) => {
|
||||
// If "all" is selected, show all providers
|
||||
if (selectedProvider === 'all') {
|
||||
return true;
|
||||
}
|
||||
// Otherwise only show the selected provider
|
||||
return addonId === selectedProvider;
|
||||
})
|
||||
.sort(([addonIdA], [addonIdB]) => {
|
||||
const indexA = installedAddons.findIndex(addon => addon.id === addonIdA);
|
||||
const indexB = installedAddons.findIndex(addon => addon.id === addonIdB);
|
||||
|
|
@ -574,6 +583,8 @@ export const StreamsScreen = () => {
|
|||
addonId,
|
||||
data: streams
|
||||
}));
|
||||
|
||||
return filteredEntries;
|
||||
}, [selectedProvider, type, episodeStreams, groupedStreams]);
|
||||
|
||||
const episodeImage = useMemo(() => {
|
||||
|
|
|
|||
Loading…
Reference in a new issue