Merge branch 'main' into lang_de
This commit is contained in:
@@ -96,7 +96,7 @@ public class Post {
|
||||
return new File(filename);
|
||||
}
|
||||
|
||||
public static ArrayList<Post> find(MailingList list, String month, List<String> allowedSenders) throws SQLException {
|
||||
public static ArrayList<Post> find(MailingList list, String month, List<String> allowedSenders) throws SQLException {
|
||||
var query = Database.open()
|
||||
.select(TABLE_NAME,"*","strftime('%Y-%m',date/1000,'unixepoch') as month")
|
||||
.where(LIST,list.email())
|
||||
@@ -140,6 +140,10 @@ public class Post {
|
||||
return id;
|
||||
}
|
||||
|
||||
public MailingList list() {
|
||||
return list;
|
||||
}
|
||||
|
||||
public static Post load(String id) throws SQLException {
|
||||
var rs = Database.open().select(TABLE_NAME).where(ID,id).compile().exec();
|
||||
try {
|
||||
@@ -160,6 +164,11 @@ public class Post {
|
||||
FILE,filename);
|
||||
}
|
||||
|
||||
public void remove() throws SQLException {
|
||||
Database.open().deleteFrom(TABLE_NAME).where(ID,id).compile().run();
|
||||
file().delete();
|
||||
}
|
||||
|
||||
public Map<String,Object> safeMap() {
|
||||
return Map.of(ID,id,
|
||||
LIST,list.name(),
|
||||
@@ -188,5 +197,4 @@ public class Post {
|
||||
public long timestamp(){
|
||||
return timestamp;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user