-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathConstantBuilder.cs
20 lines (19 loc) · 1.14 KB
/
ConstantBuilder.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
namespace Youtube_DL_Frontend {
internal class ConstantBuilder {
public static string buildFileName(string directory, string name) {
return $"{directory}\\{name}.%(ext)s";
}
public static string buildArguments(Data.DatabaseObject data, string URL, string name) {
string fileName = buildFileName(data.workingDirectory, name);
switch (data.type) {
case Data.DatabaseObject.presetType.audio:
return Data.Statics.buildPath($"-f {data.format} --audio-format {data.outputFormat} -x --ffmpeg-location \"{data.ffMpegDirectory}\" {URL} --audio-quality {data.audioQuality} -o \"{fileName}\"");
case Data.DatabaseObject.presetType.video:
return Data.Statics.buildPath($"-f {data.format} --merge-output-format {data.outputFormat} --ffmpeg-location \"{data.ffMpegDirectory}\" {URL} -o \"{fileName}\"");
case Data.DatabaseObject.presetType.subtitle:
return Data.Statics.buildPath($"--write-sub --sub-format {data.format} {URL} -o \"{fileName}\"");
}
return "";
}
}
}