private Google.Apis.Drive.v3.Data.File GetFile(IPackage package) { var files = DriveHelper.GetFiles(driveService, "properties has { key='" + PropertyModPackName + "' and value='" + PropertyReposityoryRoot + "' } and name='" + package.Id + "'"); if (files.Count > 0) { return(files[0]); } return(null); }
private void GetOrCreateModPackDirectory() { var list = DriveHelper.GetFiles(driveService, "mimeType = 'application/vnd.google-apps.folder' and 'root' in parents and trashed=false and properties has { key='" + PropertyModPackName + "' and value='" + PropertyReposityoryRoot + "'}"); if (list.Count() == 0) { googleModRoot = DriveHelper.CreateDirectory(driveService, PropertyReposityoryRoot, "root", new Dictionary <string, string> { { PropertyModPackName, PropertyReposityoryRoot } }); } else { googleModRoot = list[0]; } }
public IEnumerable <IPackage> GetPackages() { var propertiesSearch = "properties has { key='" + PropertyModPackName + "' and value='" + PropertyReposityoryRoot + "'} and mimeType != 'application/vnd.google-apps.folder'"; return(DriveHelper.GetFiles(driveService, propertiesSearch).Select(f => GetPackageFromFile(f))); }