fixed #155: Fixed FTP index

This commit is contained in:
Jaex 2014-05-31 04:27:47 +03:00
parent 739f4243a3
commit f7463f7db0
2 changed files with 14 additions and 5 deletions

View file

@ -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;
} }
} }

View file

@ -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);