diff --git a/crates/client/src/components/lens.rs b/crates/client/src/components/lens.rs
index 791b3f53b..e9707e0f9 100644
--- a/crates/client/src/components/lens.rs
+++ b/crates/client/src/components/lens.rs
@@ -85,7 +85,7 @@ pub fn lens_component(props: &LensProps) -> Html {
}}
{"Uninstall"}
-
-
{format!("Spyglass lives in your {}.", menubar_name)}
+
{format!("Spyglass lives in your {menubar_name}.")}
{format!("{click_str} on the icon to access your library, discover new lenses, and adjust your settings.")}
diff --git a/crates/entities/src/models/crawl_queue.rs b/crates/entities/src/models/crawl_queue.rs
index b30873932..3975cad77 100644
--- a/crates/entities/src/models/crawl_queue.rs
+++ b/crates/entities/src/models/crawl_queue.rs
@@ -2,7 +2,7 @@ use std::collections::HashSet;
use regex::RegexSet;
use sea_orm::entity::prelude::*;
-use sea_orm::sea_query::{OnConflict, SqliteQueryBuilder};
+use sea_orm::sea_query::{OnConflict, Query, SqliteQueryBuilder};
use sea_orm::{
sea_query, ConnectionTrait, DatabaseBackend, DbBackend, FromQueryResult, InsertResult,
QueryOrder, QueryTrait, Set, Statement,
@@ -41,6 +41,8 @@ pub struct TaskError {
#[derive(Debug, Clone, PartialEq, EnumIter, DeriveActiveEnum, Serialize, Eq)]
#[sea_orm(rs_type = "String", db_type = "String(None)")]
pub enum CrawlStatus {
+ #[sea_orm(string_value = "Initial")]
+ Initial,
#[sea_orm(string_value = "Queued")]
Queued,
#[sea_orm(string_value = "Processing")]
@@ -266,6 +268,14 @@ pub async fn num_tasks_in_progress(db: &DatabaseConnection) -> anyhow::Result
anyhow::Result {
+ Entity::find()
+ .filter(Column::Status.eq(CrawlStatus::Processing))
+ .count(db)
+ .await
+}
+
/// Get the next url in the crawl queue
pub async fn dequeue(
db: &DatabaseConnection,
@@ -284,8 +294,8 @@ pub async fn dequeue(
// Prioritize any bootstrapping tasks first.
let entity = {
let result = Entity::find()
- .filter(Column::Status.eq(CrawlStatus::Queued))
.filter(Column::CrawlType.eq(CrawlType::Bootstrap))
+ .filter(Column::Status.eq(CrawlStatus::Queued))
.one(db)
.await?;
@@ -317,6 +327,44 @@ pub async fn dequeue(
Ok(None)
}
+/// Get the next url in the crawl queue
+pub async fn dequeue_files(
+ db: &DatabaseConnection,
+ user_settings: UserSettings,
+) -> anyhow::Result