private bool CheckIfFileExistsInDB(TumblrPost downloadItem) { string filename = FileName(downloadItem); string filenameNew = FileNameNew(downloadItem); if (shellService.Settings.LoadAllDatabases) { return(managerService.CheckIfFileExistsInDB(filename)); } return(files.CheckIfFileExistsInDB(filename) || blog.CheckIfBlogShouldCheckDirectory(filename, filenameNew)); }
private bool CheckIfFileExistsInDB(string url) { if (shellService.Settings.LoadAllDatabases) { return(managerService.CheckIfFileExistsInDB(url)); } return(files.CheckIfFileExistsInDB(url) || blog.CheckIfBlogShouldCheckDirectory(GetCoreImageUrl(url))); }
public bool CheckIfFileExistsInDB(string filenameUrl) { return(files.CheckIfFileExistsInDB(filenameUrl)); }
protected virtual async Task <bool> DownloadPhotoAsync(TumblrPost downloadItem) { string url = Url(downloadItem); if (!(files.CheckIfFileExistsInDB(url) || blog.CheckIfBlogShouldCheckDirectory(GetCoreImageUrl(url)))) { string blogDownloadLocation = blog.DownloadLocation(); string fileName = FileName(downloadItem); string fileLocation = FileLocation(blogDownloadLocation, fileName); string fileLocationUrlList = FileLocationLocalized(blogDownloadLocation, Resources.FileNamePhotos); DateTime postDate = PostDate(downloadItem); UpdateProgressQueueInformation(Resources.ProgressDownloadImage, fileName); if (await DownloadBinaryFile(fileLocation, fileLocationUrlList, url)) { SetFileDate(fileLocation, postDate); UpdateBlogDB("DownloadedPhotos", fileName); if (shellService.Settings.EnablePreview) { if (!fileName.EndsWith(".gif")) { blog.LastDownloadedPhoto = Path.GetFullPath(fileLocation); } else { blog.LastDownloadedVideo = Path.GetFullPath(fileLocation); } } return(true); } return(false); } return(true); }