1
0
mirror of https://github.com/fabianonline/telegram_backup.git synced 2024-11-22 08:46:15 +00:00

Added lots of debugging to the HTML exporter and disabled direct chat generation.

This commit is contained in:
Fabian Schlenz 2017-02-18 12:55:57 +01:00
parent e0668926c9
commit 4f5d00248d

View File

@ -98,7 +98,7 @@ public class HTMLExporter {
mustache = mf.compile("templates/html/chat.mustache"); mustache = mf.compile("templates/html/chat.mustache");
int i=0; int i=0;
logger.debug("Generating {} dialog pages", dialogs.size()); /*logger.debug("Generating {} dialog pages", dialogs.size());
for (Database.Dialog d : dialogs) { for (Database.Dialog d : dialogs) {
i++; i++;
logger.trace("Dialog {}/{}: {}", i, dialogs.size(), Utils.anonymize(""+d.id)); logger.trace("Dialog {}/{}: {}", i, dialogs.size(), Utils.anonymize(""+d.id));
@ -116,25 +116,33 @@ public class HTMLExporter {
w = getWriter(base + "dialogs" + File.separatorChar + "user_" + d.id + ".html"); w = getWriter(base + "dialogs" + File.separatorChar + "user_" + d.id + ".html");
mustache.execute(w, scope); mustache.execute(w, scope);
w.close(); w.close();
} }*/
i=0; i=0;
logger.debug("Generating {} chat pages", chats.size()); logger.debug("Generating {} chat pages", chats.size());
for (Database.Chat c : chats) { for (Database.Chat c : chats) {
i++; i++;
logger.trace("Chat {}/{}: {}", i, chats.size(), Utils.anonymize(""+c.id)); logger.trace("Chat {}/{}: {}", i, chats.size(), Utils.anonymize(""+c.id));
logger.trace("getMessagesForExport");
LinkedList<HashMap<String, Object>> messages = db.getMessagesForExport(c); LinkedList<HashMap<String, Object>> messages = db.getMessagesForExport(c);
logger.trace("Preparing scope");
scope.clear(); scope.clear();
scope.put("user", user); scope.put("user", user);
scope.put("chat", c); scope.put("chat", c);
scope.put("messages", messages); scope.put("messages", messages);
logger.trace("getMessageAuthorsWithCount");
scope.putAll(db.getMessageAuthorsWithCount(c)); scope.putAll(db.getMessageAuthorsWithCount(c));
logger.trace("heatmap");
scope.put("heatmap_data", intArrayToString(db.getMessageTimesMatrix(c))); scope.put("heatmap_data", intArrayToString(db.getMessageTimesMatrix(c)));
logger.trace("getMessageTypesWithCount");
scope.putAll(db.getMessageTypesWithCount(c)); scope.putAll(db.getMessageTypesWithCount(c));
logger.trace("getMessageMediaTypesWithCount");
scope.putAll(db.getMessageMediaTypesWithCount(c)); scope.putAll(db.getMessageMediaTypesWithCount(c));
logger.trace("getWriter");
w = getWriter(base + "dialogs" + File.separatorChar + "chat_" + c.id + ".html"); w = getWriter(base + "dialogs" + File.separatorChar + "chat_" + c.id + ".html");
logger.trace("mustache.execute");
mustache.execute(w, scope); mustache.execute(w, scope);
w.close(); w.close();
} }