feat: Separate tracks by user

This commit is contained in:
joao
2025-08-15 11:13:42 -03:00
parent 0b240ba5f0
commit 696342e7dc
8 changed files with 41 additions and 2 deletions

View File

@@ -22,6 +22,7 @@ interface DownloadSettings {
deezerQuality: "MP3_128" | "MP3_320" | "FLAC";
spotifyQuality: "NORMAL" | "HIGH" | "VERY_HIGH";
recursiveQuality: boolean; // frontend field (sent as camelCase to backend)
separateTracksByUser: boolean;
}
interface WatchConfig {
@@ -195,6 +196,13 @@ export function DownloadsTab({ config, isLoading }: DownloadsTabProps) {
<label htmlFor="recursiveQualityToggle" className="text-content-primary dark:text-content-primary-dark">Recursive Quality</label>
<input id="recursiveQualityToggle" type="checkbox" {...register("recursiveQuality")} className="h-6 w-6 rounded" />
</div>
<div className="flex items-center justify-between">
<label htmlFor="separateTracksByUserToggle" className="text-content-primary dark:text-content-primary-dark">Separate tracks by user</label>
<input id="separateTracksByUserToggle" type="checkbox" {...register("separateTracksByUser")} className="h-6 w-6 rounded" />
</div>
<p className="text-sm text-content-muted dark:text-content-muted-dark">
When enabled, downloads will be organized in user-specific subdirectories (downloads/username/...)
</p>
{/* Watch validation info */}
{watchConfig?.enabled && (

View File

@@ -54,6 +54,7 @@ export type FlatAppSettings = {
hlsThreads: number;
// Frontend-only flag used in DownloadsTab
recursiveQuality: boolean;
separateTracksByUser: boolean;
// Add defaults for the new formatting properties
track: string;
album: string;
@@ -90,6 +91,7 @@ const defaultSettings: FlatAppSettings = {
hlsThreads: 8,
// Frontend-only default
recursiveQuality: false,
separateTracksByUser: false,
// Add defaults for the new formatting properties
track: "{artist_name}/{album_name}/{track_number} - {track_name}",
album: "{artist_name}/{album_name}",

View File

@@ -27,6 +27,7 @@ export interface AppSettings {
m3u: boolean;
hlsThreads: number;
recursiveQuality: boolean;
separateTracksByUser: boolean;
// Properties from the old 'formatting' object
track: string;
album: string;