diff --git a/src/main/java/de/fabianonline/telegram_backup/DatabaseUpdates.java b/src/main/java/de/fabianonline/telegram_backup/DatabaseUpdates.java index f97c231..8de519b 100644 --- a/src/main/java/de/fabianonline/telegram_backup/DatabaseUpdates.java +++ b/src/main/java/de/fabianonline/telegram_backup/DatabaseUpdates.java @@ -54,8 +54,8 @@ public class DatabaseUpdates { rs = stmt.executeQuery("SELECT MAX(version) FROM database_versions"); rs.next(); version = rs.getInt(1); - rs.close(); } + rs.close(); logger.debug("version: {}", version); System.out.println("Database version: " + version); logger.debug("Max available database version is {}", getMaxPossibleVersion()); @@ -70,8 +70,12 @@ public class DatabaseUpdates { } } if (backup) { - logger.debug("Performing backup"); - db.backupDatabase(version); + if (version > 0) { + logger.debug("Performing backup"); + db.backupDatabase(version); + } else { + logger.debug("NOT performing a backup, because we are creating a fresh database and don't need a backup of that."); + } } logger.debug("Applying updates"); diff --git a/src/main/java/de/fabianonline/telegram_backup/exporter/HTMLExporter.java b/src/main/java/de/fabianonline/telegram_backup/exporter/HTMLExporter.java index 3c20e68..a44bb65 100644 --- a/src/main/java/de/fabianonline/telegram_backup/exporter/HTMLExporter.java +++ b/src/main/java/de/fabianonline/telegram_backup/exporter/HTMLExporter.java @@ -95,6 +95,7 @@ public class HTMLExporter { for (Database.Dialog d : dialogs) { LinkedList> messages = db.getMessagesForExport(d); scope.clear(); + scope.put("user", user); scope.put("dialog", d); scope.put("messages", messages); @@ -112,9 +113,11 @@ public class HTMLExporter { for (Database.Chat c : chats) { LinkedList> messages = db.getMessagesForExport(c); scope.clear(); + scope.put("user", user); scope.put("chat", c); scope.put("messages", messages); + scope.putAll(db.getMessageAuthorsWithCount(c)); scope.put("heatmap_data", intArrayToString(db.getMessageTimesMatrix(c))); scope.putAll(db.getMessageTypesWithCount(c)); scope.putAll(db.getMessageMediaTypesWithCount(c)); diff --git a/src/main/resources/templates/html/_stats.mustache b/src/main/resources/templates/html/_stats.mustache index 71bc326..e1c6ec8 100644 --- a/src/main/resources/templates/html/_stats.mustache +++ b/src/main/resources/templates/html/_stats.mustache @@ -98,6 +98,15 @@ {name: 'Others', y: {{authors.count.others}}, drilldown: 'Others'}, ] }], + plotOptions: { + pie: { + dataLabels: { + style: { + width: '150px', + }, + }, + }, + }, drilldown: { series: [{ name: 'Authors', @@ -152,9 +161,11 @@ }); - + -{{#count.dialogs}}{{/count.dialogs}} - - - +{{#count.dialogs}} + +{{/count.dialogs}} + + +