public async Task <DateTime> LatestSync(FolderMapping mapping) { if (mapping == null || mapping.FriendlyName == null) { return(DateTime.MinValue); } string path = folderRoot + mapping.FriendlyName + "/"; if (!await client.DirectoryExistsAsync(path)) { return(DateTime.MinValue); } FtpListItem[] folders = await client.GetListingAsync(path); if (folders.Length == 0) { return(DateTime.MinValue); } List <DateTime> folderDateTimes = folders.Select(x => DateTimeDirUtils.GetDirDateTime(x.Name)).ToList(); folderDateTimes.Sort(); return(folderDateTimes.Last()); }
private async Task <DateTime> LatestSync(string friendlyName) { string path = folderRoot + friendlyName + "/"; if (!await client.DirectoryExistsAsync(path)) { return(DateTime.MinValue); } FtpListItem[] folders = await client.GetListingAsync(path); if (folders.Length == 0) { return(DateTime.MinValue); } List <DateTime> folderDateTimes = folders.Select(x => DateTimeDirUtils.GetDirDateTime(x.Name)).ToList(); folderDateTimes.Sort(); return(folderDateTimes.Last()); }