feat(library and playback): Support for serverside channel plugins and hls streaming
This commit is contained in:
@@ -152,6 +152,47 @@ function createLibraryStore() {
|
||||
}
|
||||
}
|
||||
|
||||
// Load Live TV channels (broadcast / IPTV) into the items list. Live TV uses a
|
||||
// dedicated Jellyfin endpoint rather than the generic /Items browse.
|
||||
async function loadLiveTvChannels() {
|
||||
update((s) => ({ ...s, loadingCount: s.loadingCount + 1, error: null }));
|
||||
try {
|
||||
const repo = auth.getRepository();
|
||||
const channels = await repo.getLiveTvChannels();
|
||||
update((s) => ({
|
||||
...s,
|
||||
items: channels,
|
||||
totalItems: channels.length,
|
||||
loadingCount: Math.max(0, s.loadingCount - 1),
|
||||
}));
|
||||
return channels;
|
||||
} catch (error) {
|
||||
const message = error instanceof Error ? error.message : "Failed to load Live TV channels";
|
||||
update((s) => ({ ...s, loadingCount: Math.max(0, s.loadingCount - 1), error: message }));
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
|
||||
// Load the root list of plugin "Channels" into the items list.
|
||||
async function loadChannels() {
|
||||
update((s) => ({ ...s, loadingCount: s.loadingCount + 1, error: null }));
|
||||
try {
|
||||
const repo = auth.getRepository();
|
||||
const result = await repo.getChannels();
|
||||
update((s) => ({
|
||||
...s,
|
||||
items: result.items,
|
||||
totalItems: result.totalRecordCount,
|
||||
loadingCount: Math.max(0, s.loadingCount - 1),
|
||||
}));
|
||||
return result;
|
||||
} catch (error) {
|
||||
const message = error instanceof Error ? error.message : "Failed to load channels";
|
||||
update((s) => ({ ...s, loadingCount: Math.max(0, s.loadingCount - 1), error: message }));
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
|
||||
async function loadItem(itemId: string) {
|
||||
update((s) => ({ ...s, loadingCount: s.loadingCount + 1, error: null }));
|
||||
|
||||
@@ -297,6 +338,8 @@ function createLibraryStore() {
|
||||
subscribe,
|
||||
loadLibraries,
|
||||
loadItems,
|
||||
loadLiveTvChannels,
|
||||
loadChannels,
|
||||
loadItem,
|
||||
search,
|
||||
setCurrentLibrary,
|
||||
|
||||
Reference in New Issue
Block a user