mirror of
https://github.com/neosubhamoy/neodlp.git
synced 2026-03-22 06:55:51 +05:30
@@ -282,7 +282,7 @@ function AppAppearanceSettings() {
|
||||
);
|
||||
}
|
||||
|
||||
function AppFolderSettings() {
|
||||
function AppFilesystemSettings() {
|
||||
const { saveSettingsKey } = useSettings();
|
||||
|
||||
const isFlatpak = useEnvironmentStore(state => state.isFlatpak);
|
||||
@@ -295,6 +295,8 @@ function AppFolderSettings() {
|
||||
const setPath = useBasePathsStore((state) => state.setPath);
|
||||
|
||||
const filenameTemplate = useSettingsPageStatesStore(state => state.settings.filename_template);
|
||||
const windowsFilenames = useSettingsPageStatesStore(state => state.settings.windows_filenames);
|
||||
const restrictFilenames = useSettingsPageStatesStore(state => state.settings.restrict_filenames);
|
||||
|
||||
const downloadStates = useDownloadStatesStore(state => state.downloadStates);
|
||||
const ongoingDownloads = downloadStates.filter(state =>
|
||||
@@ -448,6 +450,26 @@ function AppFolderSettings() {
|
||||
</form>
|
||||
</Form>
|
||||
</div>
|
||||
<div className="sanitize-filenames">
|
||||
<h3 className="font-semibold">Sanitize Filenames</h3>
|
||||
<p className="text-xs text-muted-foreground mb-3">Make filenames windows-compatible, allow only ASCII characters and replace spaces with underscore (recommended, disabling it may cause issue with some downloads, also it may cause paused downloads to re-start from begining)</p>
|
||||
<div className="flex items-center space-x-2 mb-3">
|
||||
<Switch
|
||||
id="windows-filenames"
|
||||
checked={windowsFilenames}
|
||||
onCheckedChange={(checked) => saveSettingsKey('windows_filenames', checked)}
|
||||
/>
|
||||
<Label htmlFor="windows-filenames">Windows Compatibility</Label>
|
||||
</div>
|
||||
<div className="flex items-center space-x-2">
|
||||
<Switch
|
||||
id="restrict-filenames"
|
||||
checked={restrictFilenames}
|
||||
onCheckedChange={(checked) => saveSettingsKey('restrict_filenames', checked)}
|
||||
/>
|
||||
<Label htmlFor="restrict-filenames">Force ASCII Only</Label>
|
||||
</div>
|
||||
</div>
|
||||
</>
|
||||
);
|
||||
}
|
||||
@@ -1933,7 +1955,7 @@ export function ApplicationSettings() {
|
||||
const tabsList = [
|
||||
{ key: 'general', label: 'General', icon: Wrench, component: <AppGeneralSettings /> },
|
||||
{ key: 'appearance', label: 'Appearance', icon: WandSparkles, component: <AppAppearanceSettings /> },
|
||||
{ key: 'folders', label: 'Folders', icon: Folder, component: <AppFolderSettings /> },
|
||||
{ key: 'filesystem', label: 'Filesystem', icon: Folder, component: <AppFilesystemSettings /> },
|
||||
{ key: 'formats', label: 'Formats', icon: FileVideo, component: <AppFormatSettings /> },
|
||||
{ key: 'embedding', label: 'Embedding', icon: FilePen, component: <AppEmbeddingSettings /> },
|
||||
{ key: 'network', label: 'Network', icon: Wifi, component: <AppNetworkSettings /> },
|
||||
|
||||
@@ -72,6 +72,8 @@ export default function useDownloader() {
|
||||
use_potoken: USE_POTOKEN,
|
||||
disable_innertube: DISABLE_INNERTUBE,
|
||||
pot_server_port: POT_SERVER_PORT,
|
||||
windows_filenames: WINDOWS_FILENAMES,
|
||||
restrict_filenames: RESTRICT_FILENAMES
|
||||
} = useSettingsPageStatesStore(state => state.settings);
|
||||
const isRunningPotServer = useSettingsPageStatesStore(state => state.isRunningPotServer);
|
||||
|
||||
@@ -332,8 +334,6 @@ export default function useDownloader() {
|
||||
`temp:${tempDownloadDirPath}`,
|
||||
'--paths',
|
||||
`home:${downloadDirPath}`,
|
||||
'--windows-filenames',
|
||||
'--restrict-filenames',
|
||||
'--exec',
|
||||
'after_move:echo Finalpath: {}',
|
||||
'--no-mtime',
|
||||
@@ -351,6 +351,14 @@ export default function useDownloader() {
|
||||
args.push('--output', `${FILENAME_TEMPLATE}[${downloadId}].%(ext)s`);
|
||||
}
|
||||
|
||||
if (WINDOWS_FILENAMES) {
|
||||
args.push('--windows-filenames');
|
||||
}
|
||||
|
||||
if (RESTRICT_FILENAMES) {
|
||||
args.push('--restrict-filenames');
|
||||
}
|
||||
|
||||
if ((!USE_CUSTOM_COMMANDS && !resumeState?.custom_command) && USE_DELAY) {
|
||||
if (!DELAY_PLAYLIST_ONLY) {
|
||||
if (DELAY_MODE === 'auto') {
|
||||
|
||||
@@ -221,6 +221,8 @@ export const useSettingsPageStatesStore = create<SettingsPageStatesStore>((set)
|
||||
use_potoken: false,
|
||||
disable_innertube: false,
|
||||
pot_server_port: 4416,
|
||||
windows_filenames: true,
|
||||
restrict_filenames: true,
|
||||
// extension settings
|
||||
websocket_port: 53511
|
||||
},
|
||||
@@ -306,6 +308,8 @@ export const useSettingsPageStatesStore = create<SettingsPageStatesStore>((set)
|
||||
use_potoken: false,
|
||||
disable_innertube: false,
|
||||
pot_server_port: 4416,
|
||||
windows_filenames: true,
|
||||
restrict_filenames: true,
|
||||
// extension settings
|
||||
websocket_port: 53511
|
||||
},
|
||||
|
||||
@@ -64,6 +64,8 @@ export interface Settings {
|
||||
use_potoken: boolean;
|
||||
disable_innertube: boolean;
|
||||
pot_server_port: number;
|
||||
windows_filenames: boolean;
|
||||
restrict_filenames: boolean;
|
||||
// extension settings
|
||||
websocket_port: number;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user