public void PicasaDeleteAll(string localPath) { var picasa = new PicasaClient(); LogText("GetAlbums..."); var albums = picasa.GetAlbums(); ResetProgress(albums.Count); LogText("Delete from albums..."); foreach (var album in albums) { var picFiles = picasa.GetPhotos(album.Id); foreach (var picFile in picFiles) { picasa.DeletePhoto(picFile); } IncreaseProgress(); } LogText("Get all files in " + localPath); var files = System.IO.Directory.GetFiles(localPath, "*", System.IO.SearchOption.AllDirectories); ResetProgress(files.Length); var searched = new HashSet<string>(); foreach (var localFile in files) { var fName = System.IO.Path.GetFileName(localFile); if (searched.Contains(fName)) continue; searched.Add(fName); var filesForDel = picasa.GetPhotos(null, fName); foreach (var picFile in filesForDel) { picasa.DeletePhoto(picFile); } IncreaseProgress(); } ResetProgress(10); LogText("READY"); }
private void button1_Click(object sender, EventArgs e) { PicasaClient picasa = new PicasaClient(); var alreadyFoundExt = new HashSet<string>(); //picasa.Test(); var foundAlbums = new HashSet<string>(); var picasaFoundFiles = picasa.GetPhotos(null, ".avi"); PicasaEntry pe = null; foreach (var file in picasaFoundFiles) { var ph = new PhotoAccessor(file); if (ph.PhotoTitle.ToLower()== "2005-12-16Mafia.avi".ToLower()) { pe = file; var value = ph.Timestamp; var tmp = new DateTime(1970, 1, 1, 0, 0, 0); tmp = tmp.AddMilliseconds(value); break; } } picasa.SetPhotoCreationDate(pe, DateTime.Now); MessageBox.Show(pe.Title.ToString()); }
void AddPicasaFiles(PicasaClient picasa, Dictionary<string, List<PicasaEntry>> picasaFiles, HashSet<string> picasaFilesId, string albumId = null, string searchText = null) { var pf = picasa.GetPhotos(albumId, searchText); foreach (var entry in pf) AddPicasaFile(entry, picasaFiles, picasaFilesId); }