Skip to content

Commit d896df1

Browse files
committed
Change database type to JSON in Config; enhance notification handling with default notification creation
1 parent e1e05cd commit d896df1

2 files changed

Lines changed: 3 additions & 1 deletion

File tree

src/main/java/com/kingpixel/cobblenotify/config/Config.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ public class Config {
2323
public Config() {
2424
if (database == null) {
2525
database = new DataBaseConfig();
26-
database.setType(DataBaseType.MONGODB);
26+
database.setType(DataBaseType.JSON);
2727
database.setUrl("mongodb://localhost:27017");
2828
database.setDatabase("cobblenotify");
2929
}

src/main/java/com/kingpixel/cobblenotify/config/Notifications.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ public static void init() {
3434
notification.check();
3535
NOTIFICATIONS.add(notification);
3636
Utils.writeFileAsync(f, Utils.newGson().toJson(notification));
37+
} else {
38+
Utils.writeFileAsync(f, Utils.newGson().toJson(new Notification(f.getName().replace(".json", ""))));
3739
}
3840
} catch (Exception e) {
3941
e.printStackTrace();

0 commit comments

Comments
 (0)