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