diff --git a/src/branch.v b/src/branch.v index 226b8e8..0b7fb3c 100644 --- a/src/branch.v +++ b/src/branch.v @@ -43,7 +43,7 @@ fn (mut app App) fetch_branch(repo Repo, branch_name string) ! { } app.create_branch_or_update(repo.id, branch_name, user.username, last_commit_hash, - int(committed_at.unix))! + int(committed_at.unix()))! } fn (mut app App) create_branch_or_update(repository_id int, branch_name string, author string, hash string, date int) ! { diff --git a/src/comment.v b/src/comment.v index aeb6ee5..223f02c 100644 --- a/src/comment.v +++ b/src/comment.v @@ -39,7 +39,7 @@ fn (mut app App) add_issue_comment(author_id int, issue_id int, text string) ! { comment := Comment{ author_id: author_id issue_id: issue_id - created_at: int(time.now().unix) + created_at: int(time.now().unix()) text: text } diff --git a/src/gitly.v b/src/gitly.v index 010d51f..da61d23 100644 --- a/src/gitly.v +++ b/src/gitly.v @@ -48,7 +48,7 @@ fn new_app() !&App { mut app := &App{ db: sqlite.connect('gitly.sqlite') or { panic(err) } - started_at: time.now().unix + started_at: time.now().unix() } set_rand_crypto_safe_seed() diff --git a/src/issue.v b/src/issue.v index ab34c0d..8c3c4bd 100644 --- a/src/issue.v +++ b/src/issue.v @@ -39,7 +39,7 @@ fn (mut app App) add_issue(repo_id int, author_id int, title string, text string text: text repo_id: repo_id author_id: author_id - created_at: int(time.now().unix) + created_at: int(time.now().unix()) } sql app.db { diff --git a/src/repo.v b/src/repo.v index 1818ed1..b8f1b73 100644 --- a/src/repo.v +++ b/src/repo.v @@ -322,7 +322,7 @@ fn (mut app App) update_repo_branch_from_fs(mut repo Repo, branch_name string) ! } app.add_commit_if_not_exist(repo_id, branch.id, commit_hash, commit_author, - commit_author_id, commit_message, int(commit_date.unix))! + commit_author_id, commit_message, int(commit_date.unix()))! } } } @@ -396,7 +396,7 @@ fn (mut app App) update_repo_branch_data(mut repo Repo, branch_name string) ! { } app.add_commit_if_not_exist(repo_id, branch.id, commit_hash, commit_author, - commit_author_id, commit_message, int(commit_date.unix))! + commit_author_id, commit_message, int(commit_date.unix()))! } } } diff --git a/src/tag.v b/src/tag.v index 64020b0..4b96e2c 100644 --- a/src/tag.v +++ b/src/tag.v @@ -36,7 +36,7 @@ fn (mut app App) fetch_tags(repo Repo) ! { } app.insert_tag_into_db(repo.id, tag_name, commit_hash, commit_message, user.id, - int(commit_date.unix))! + int(commit_date.unix()))! } } diff --git a/src/user.v b/src/user.v index fe86c99..310e782 100644 --- a/src/user.v +++ b/src/user.v @@ -326,8 +326,8 @@ pub fn (mut app App) increment_user_post(mut user User) ! { u := *user id := u.id - now := int(time.now().unix) - lastplus := int(time.unix(u.last_post_time).add_days(1).unix) + now := int(time.now().unix()) + lastplus := int(time.unix(u.last_post_time).add_days(1).unix()) if now >= lastplus { user.last_post_time = now @@ -376,7 +376,7 @@ fn (mut app App) change_full_name(user_id int, full_name string) ! { } fn (mut app App) incement_namechanges(user_id int) ! { - now := int(time.now().unix) + now := int(time.now().unix()) sql app.db { update User set namechanges_count = namechanges_count + 1, last_namechange_time = now diff --git a/src/user_routes.v b/src/user_routes.v index 920bc09..28eac39 100644 --- a/src/user_routes.v +++ b/src/user_routes.v @@ -132,7 +132,7 @@ pub fn (mut app App) handle_update_user_settings(username string) vweb.Result { } is_first_namechange := app.user.last_namechange_time == 0 - can_change_usernane := app.user.last_namechange_time + namechange_period <= time.now().unix + can_change_usernane := app.user.last_namechange_time + namechange_period <= time.now().unix() if !(is_first_namechange || can_change_usernane) { app.error('You need to wait until you can change the name again') diff --git a/src/utils.v b/src/utils.v index a3e0b6d..00b4bc4 100644 --- a/src/utils.v +++ b/src/utils.v @@ -5,7 +5,7 @@ import math import os pub fn (mut app App) running_since() string { - duration := time.now().unix - app.started_at + duration := time.now().unix() - app.started_at seconds_in_hour := 60 * 60