!INFO: tried to move to postgreSQL did not work

fix: fixed bumping, fixed banning from Reports Menu
feat: improved homepage, finilized comments and posts, moved version from nav menu to sidebar

Signed-off-by: limited_dev <loginakkisativ@gmail.com>
This commit is contained in:
limited_dev 2023-06-13 23:34:16 +02:00
parent 7bd31ea7b5
commit 73be698399
12 changed files with 188 additions and 47 deletions

View file

@ -6,7 +6,7 @@ namespace ImageBoardServerApp.Util;
public class TheManager
{
public static string version = "1.0.0-c1";
public static string version = "v1.0.0-rc1";
private static long getDiff(PostData post)
{
@ -38,14 +38,17 @@ public class TheManager
public static async Task bumpThreads(BoardData board)
{
Console.WriteLine("Bumping..");
List<PostData> sortedThreads = await getPostList(board.Tag);
if (sortedThreads.Count > board.maxThreads + 1)
{
for (int i = board.maxThreads + 1; i >= sortedThreads.Count; ++i)
Console.WriteLine("Pruning..");
foreach (var pd in sortedThreads.TakeLast(sortedThreads.Count() - board.maxThreads))
{
if (sortedThreads[i].IsSticky)
if (pd.IsSticky)
continue;
await deleteThread(sortedThreads[i]);
Console.WriteLine($"Removing Post{pd.PostID}");
await deleteThread(pd);
}
}
}
@ -111,8 +114,8 @@ public class TheManager
public static DateTime ConvertToDateTime(long timestamp)
{
DateTime unixEpoch = new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc);
DateTime date = unixEpoch.AddSeconds(timestamp);
return date;
DateTime dateTime = new DateTime(1970, 1, 1, 0, 0, 0, 0, DateTimeKind.Utc);
dateTime = dateTime.AddMilliseconds(timestamp).ToLocalTime();
return dateTime;
}
}