!7 sclass ZipTextSnippets > DynSingleFunctionWithPrintLog { switchable bool withPrivate; void doIt ctex { bool withPrivate = ZipTextSnippets.this.withPrivate; L snippets = cast call(dm_getModule(dm_snippetsDB()), 'allSnippets); print("Got " + n2(snippets, "snippet")); File zipFile = javaxBackupDir("botcompany-texts-" + ymdWithMinuses() + (withPrivate ? "-with-private" : "") + ".zip"); print("Zipping to " + zipFile + "..."); new TreeMap titles; { temp ZipOutputStream zipOut = zipOutputStream(zipFile); new Var size; for (O sn : snippets) { if (!withPrivate && !isTrue(get isPublic(sn))) continue; if (eq(rcall textLength(sn), 0)) continue; long id = getLong(sn, 'snippetID); S title = getString title(sn); titles.put(id, title); addFileToZip(zipOut, (File) call(sn, 'file), id + ".text"); if (setVar_trueIfChanged(size, fileSizeInMegabytes_floor(zipFile))) print(size + " MB"); } zip_addTextFile(zipOut, "titles.text", mapToLines(titles, (id, title) -> id + ": " + firstLine(title)); } printFileInfo(zipFile); zipToLineComp(zipFile); //uploadFileToFileServer(zipFile, zipFile.getName()); } }