mirror of
https://github.com/ShareX/ShareX.git
synced 2024-07-01 04:30:49 +12:00
fixed #155: Fixed FTP index
This commit is contained in:
parent
739f4243a3
commit
f7463f7db0
|
@ -67,6 +67,7 @@ public string Description
|
|||
public FileDestination FileDestination = FileDestination.Dropbox;
|
||||
public UrlShortenerType URLShortenerDestination = UrlShortenerType.BITLY;
|
||||
public SocialNetworkingService SocialNetworkingServiceDestination = SocialNetworkingService.Twitter;
|
||||
|
||||
public bool OverrideFTP = false;
|
||||
public int FTPIndex = 0;
|
||||
|
||||
|
@ -111,9 +112,9 @@ public bool IsUsingDefaultSettings
|
|||
{
|
||||
get
|
||||
{
|
||||
return UseDefaultAfterCaptureJob && UseDefaultAfterUploadJob && UseDefaultDestinations && UseDefaultGeneralSettings &&
|
||||
UseDefaultImageSettings && UseDefaultCaptureSettings && UseDefaultUploadSettings && UseDefaultActions &&
|
||||
UseDefaultIndexerSettings && UseDefaultAdvancedSettings && !WatchFolderEnabled;
|
||||
return UseDefaultAfterCaptureJob && UseDefaultAfterUploadJob && UseDefaultDestinations && !OverrideFTP && UseDefaultGeneralSettings &&
|
||||
UseDefaultImageSettings && UseDefaultCaptureSettings && UseDefaultUploadSettings && UseDefaultActions && UseDefaultIndexerSettings &&
|
||||
UseDefaultAdvancedSettings && !WatchFolderEnabled;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -837,8 +837,16 @@ public UploadResult UploadFile(Stream stream, string fileName)
|
|||
}
|
||||
break;
|
||||
case FileDestination.FTP:
|
||||
int index = Info.TaskSettings.OverrideFTP ? Info.TaskSettings.FTPIndex.BetweenOrDefault(0, Program.UploadersConfig.FTPAccountList.Count - 1) :
|
||||
Program.UploadersConfig.GetFTPIndex(Info.DataType);
|
||||
int index;
|
||||
|
||||
if (Info.TaskSettings.OverrideFTP)
|
||||
{
|
||||
index = Info.TaskSettings.FTPIndex.BetweenOrDefault(0, Program.UploadersConfig.FTPAccountList.Count - 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
index = Program.UploadersConfig.GetFTPIndex(Info.DataType);
|
||||
}
|
||||
|
||||
FTPAccount account = Program.UploadersConfig.FTPAccountList.ReturnIfValidIndex(index);
|
||||
|
||||
|
|
Loading…
Reference in a new issue