VideoThumbnailer auto create folder

This commit is contained in:
Jaex 2015-08-15 08:13:51 +03:00
parent dd266252cd
commit 23f13e0eb0
2 changed files with 13 additions and 4 deletions

View file

@ -605,7 +605,7 @@ Would you like to download and install it?</value>
<value>Update is available</value>
</data>
<data name="Helpers_CreateDirectoryIfNotExist_Create_failed_" xml:space="preserve">
<value>Could not create directory, check your path settings.</value>
<value>Could not create directory.</value>
</data>
<data name="HotkeyType_ColorPicker" xml:space="preserve">
<value>Color picker</value>

View file

@ -146,16 +146,25 @@ protected void OnProgressChanged(int current, int length)
private string GetOutputDirectory()
{
string directory;
switch (Options.OutputLocation)
{
default:
case ThumbnailLocationType.DefaultFolder:
return Options.DefaultOutputDirectory;
directory = Options.DefaultOutputDirectory;
break;
case ThumbnailLocationType.ParentFolder:
return Path.GetDirectoryName(MediaPath);
directory = Path.GetDirectoryName(MediaPath);
break;
case ThumbnailLocationType.CustomFolder:
return Options.CustomOutputDirectory;
directory = Options.CustomOutputDirectory;
break;
}
Helpers.CreateDirectoryIfNotExist(directory, false);
return directory;
}
private int GetTimeSlice(int count)