ytptube/ui/app/utils/ytdlpOptions.ts
2026-03-25 22:59:53 +03:00

17 lines
452 B
TypeScript

export const YTDLP_ALL_GROUPS = '__all_groups__';
type YTDLPGroupItem = {
label: string;
value: string;
};
export const buildYtdlpGroupItems = (groups: string[]): YTDLPGroupItem[] => {
return [
{ label: 'All groups', value: YTDLP_ALL_GROUPS },
...groups.map((group) => ({ label: group, value: group })),
];
};
export const normalizeYtdlpGroupFilter = (value: string): string => {
return value === YTDLP_ALL_GROUPS ? '' : value;
};