|
@@ -257,10 +257,6 @@ namespace ClankerSaddle.Services {
|
|
|
};
|
|
};
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- /**
|
|
|
|
|
- * Lists tasks, optionally filtered by status and/or project, ordered
|
|
|
|
|
- * by priority (1 first) then creation time.
|
|
|
|
|
- */
|
|
|
|
|
/**
|
|
/**
|
|
|
* Computed display states for a batch of tasks (all lists share
|
|
* Computed display states for a batch of tasks (all lists share
|
|
|
* this), keyed by task id string. Unanswered review blocks load
|
|
* this), keyed by task id string. Unanswered review blocks load
|
|
@@ -332,6 +328,10 @@ namespace ClankerSaddle.Services {
|
|
|
return TaskDisplay.compute(detail.task, review_pending, goal_review_pending);
|
|
return TaskDisplay.compute(detail.task, review_pending, goal_review_pending);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * Lists tasks, optionally filtered by status and/or project, ordered
|
|
|
|
|
+ * by priority (1 first) then creation time.
|
|
|
|
|
+ */
|
|
|
public async ImmutableLot<TaskEntity> list_tasks(string? status, int64? project_id) throws Error {
|
|
public async ImmutableLot<TaskEntity> list_tasks(string? status, int64? project_id) throws Error {
|
|
|
var tasks = yield db.query<TaskEntity>().materialise_async();
|
|
var tasks = yield db.query<TaskEntity>().materialise_async();
|
|
|
var rows = new Vector<TaskEntity>();
|
|
var rows = new Vector<TaskEntity>();
|
|
@@ -744,23 +744,6 @@ namespace ClankerSaddle.Services {
|
|
|
.materialise_async();
|
|
.materialise_async();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- /**
|
|
|
|
|
- * True when any of the task's sessions carries a `yeehaw` entry —
|
|
|
|
|
- * the badge's presence check, one cheap EXISTS over the existing
|
|
|
|
|
- * `session_commands` rows (nothing new is stored for the badge).
|
|
|
|
|
- */
|
|
|
|
|
- public async bool has_yeehaw(int64 task_id) throws Error {
|
|
|
|
|
- var command = connection.create_command(
|
|
|
|
|
- "SELECT EXISTS(SELECT 1 FROM session_commands sc"
|
|
|
|
|
- + " JOIN sessions s ON s.id = sc.session_id"
|
|
|
|
|
- + " WHERE s.task_id = :task AND sc.type = :kind) AS hit");
|
|
|
|
|
- command.with_parameter<Invercargill.Element>("task", elem<int64?>(task_id));
|
|
|
|
|
- command.with_parameter<Invercargill.Element>("kind", elem(ENTRY_YEEHAW));
|
|
|
|
|
- var hit = yield command.execute_scalar_async();
|
|
|
|
|
- int64? value = 0;
|
|
|
|
|
- return hit != null && hit.try_get_as<int64?>(out value) && ((!)value) != 0;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
/**
|
|
/**
|
|
|
* Every task id whose sessions carry a `yeehaw` entry (stringly
|
|
* Every task id whose sessions carry a `yeehaw` entry (stringly
|
|
|
* keyed) — the batch presence check the task list and the
|
|
* keyed) — the batch presence check the task list and the
|
|
@@ -1099,8 +1082,7 @@ namespace ClankerSaddle.Services {
|
|
|
var saddle = yield db.query<Saddle>()
|
|
var saddle = yield db.query<Saddle>()
|
|
|
.where(expr("id == $0", elem<int64?>(((!)session).saddle_id)))
|
|
.where(expr("id == $0", elem<int64?>(((!)session).saddle_id)))
|
|
|
.first_async();
|
|
.first_async();
|
|
|
- if (saddle != null && (((!)saddle).status == "offline"
|
|
|
|
|
- || ((!)saddle).status == "recovering")) {
|
|
|
|
|
|
|
+ if (saddle != null && ((!)saddle).status == "offline") {
|
|
|
ids.add(task.id.to_string());
|
|
ids.add(task.id.to_string());
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -1301,7 +1283,6 @@ namespace ClankerSaddle.Services {
|
|
|
yield pulse.bump(task_id, "task suspended");
|
|
yield pulse.bump(task_id, "task suspended");
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- /**
|
|
|
|
|
/** Withdraws the suspension stamp after a successful resume. */
|
|
/** Withdraws the suspension stamp after a successful resume. */
|
|
|
public async void clear_suspension(int64 task_id) throws Error {
|
|
public async void clear_suspension(int64 task_id) throws Error {
|
|
|
var task = yield db.query<TaskEntity>()
|
|
var task = yield db.query<TaskEntity>()
|