Compare commits
No commits in common. "c2b9b5759a9c0b53920f8c49834cc4a4092a1b6f" and "5439786652669788d8e6a5b712643df9e422c36f" have entirely different histories.
c2b9b5759a
...
5439786652
8
.gitignore
vendored
8
.gitignore
vendored
@ -3,11 +3,3 @@ dist/
|
||||
release/
|
||||
*.log
|
||||
.DS_Store
|
||||
|
||||
# Test-Artefakte
|
||||
tmp_e2e_full/
|
||||
tmp_bugtest/
|
||||
tmp_dl/
|
||||
|
||||
# Dev-Scripts ohne Token (Stub, nicht produktiv)
|
||||
codeberg_api_upload.sh
|
||||
|
||||
4
package-lock.json
generated
4
package-lock.json
generated
@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "twitch-vod-manager",
|
||||
"version": "5.1.0-alpha.2",
|
||||
"version": "5.1.0-alpha.1",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "twitch-vod-manager",
|
||||
"version": "5.1.0-alpha.2",
|
||||
"version": "5.1.0-alpha.1",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"axios": "^1.6.0",
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "twitch-vod-manager",
|
||||
"version": "5.1.0-alpha.2",
|
||||
"version": "5.1.0-alpha.1",
|
||||
"description": "Twitch VOD Manager - Download Twitch VODs easily",
|
||||
"main": "dist/main.js",
|
||||
"author": "xRangerDE",
|
||||
|
||||
@ -18,55 +18,27 @@ interface PaletteCommand {
|
||||
};
|
||||
|
||||
function buildCommands(): PaletteCommand[] {
|
||||
const w = window as unknown as {
|
||||
showTab?: (tab: string) => void;
|
||||
selectStreamer?: (name: string, forceRefresh?: boolean) => Promise<void>;
|
||||
config?: { streamers?: Array<{ name: string }> };
|
||||
};
|
||||
const showTab = w.showTab;
|
||||
const showTab = (window as unknown as { showTab?: (tab: string) => void }).showTab;
|
||||
if (typeof showTab !== 'function') {
|
||||
return [];
|
||||
}
|
||||
|
||||
const tabs: Array<{ id: string; labels: string[]; hint: string }> = [
|
||||
{ id: 'vods', labels: ['VODs', 'videos', 'streams'], hint: 'Tab' },
|
||||
{ id: 'queue', labels: ['Queue', 'downloads', 'warteschlange'], hint: 'Tab' },
|
||||
{ id: 'streamers', labels: ['Streamers', 'channels'], hint: 'Tab' },
|
||||
{ id: 'stats', labels: ['Stats', 'statistiken', 'dashboard'], hint: 'Tab' },
|
||||
{ id: 'archive', labels: ['Archive', 'archiv'], hint: 'Tab' },
|
||||
{ id: 'settings', labels: ['Settings', 'einstellungen', 'config'], hint: 'Tab' },
|
||||
{ id: 'vods', labels: ['VODs', 'videos', 'streams'], hint: 'Go' },
|
||||
{ id: 'queue', labels: ['Queue', 'downloads', 'warteschlange'], hint: 'Go' },
|
||||
{ id: 'streamers', labels: ['Streamers', 'channels'], hint: 'Go' },
|
||||
{ id: 'stats', labels: ['Stats', 'statistiken', 'dashboard'], hint: 'Go' },
|
||||
{ id: 'archive', labels: ['Archive', 'archiv'], hint: 'Go' },
|
||||
{ id: 'settings', labels: ['Settings', 'einstellungen', 'config'], hint: 'Go' },
|
||||
];
|
||||
|
||||
const tabCommands: PaletteCommand[] = tabs.map(t => ({
|
||||
return tabs.map(t => ({
|
||||
id: 'tab:' + t.id,
|
||||
label: t.labels[0],
|
||||
hint: t.hint,
|
||||
keywords: t.labels.join(' ').toLowerCase(),
|
||||
action: () => showTab(t.id),
|
||||
}));
|
||||
|
||||
// Streamer-Liste aus globalem config (gefuellt nach renderer-Init).
|
||||
const streamerCommands: PaletteCommand[] = [];
|
||||
const streamers = Array.isArray(w.config?.streamers) ? w.config.streamers : [];
|
||||
const selectStreamer = w.selectStreamer;
|
||||
if (typeof selectStreamer === 'function') {
|
||||
for (const entry of streamers) {
|
||||
if (!entry || typeof entry.name !== 'string') continue;
|
||||
const name = entry.name;
|
||||
streamerCommands.push({
|
||||
id: 'streamer:' + name.toLowerCase(),
|
||||
label: name,
|
||||
hint: 'Streamer',
|
||||
keywords: ('@' + name + ' ' + name).toLowerCase(),
|
||||
action: () => {
|
||||
showTab('vods');
|
||||
void selectStreamer(name);
|
||||
},
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
return [...tabCommands, ...streamerCommands];
|
||||
}
|
||||
|
||||
function getModal(): HTMLElement | null {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user