This commit is contained in:
Felix Ableitner 2024-03-07 13:08:37 +01:00
parent d043d6ddaa
commit c791b880a4
3 changed files with 16 additions and 19 deletions

3
Cargo.lock generated
View file

@ -17,8 +17,7 @@ checksum = "8f27d075294830fcab6f66e320dab524bc6d048f4a151698e153205559113772"
[[package]] [[package]]
name = "activitypub_federation" name = "activitypub_federation"
version = "0.5.1" version = "0.5.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "git+https://github.com/LemmyNet/activitypub-federation-rust.git?branch=debug-signed-fetch#294c77c01b6cc5fd1b34126710edc56cd9769789"
checksum = "eee115a53849bbcac6c953495b5f9322b56680c0a1bdef6813183f0453f9ee3c"
dependencies = [ dependencies = [
"activitystreams-kinds", "activitystreams-kinds",
"actix-web", "actix-web",

View file

@ -96,7 +96,7 @@ lemmy_routes = { version = "=0.19.3", path = "./crates/routes" }
lemmy_db_views = { version = "=0.19.3", path = "./crates/db_views" } lemmy_db_views = { version = "=0.19.3", path = "./crates/db_views" }
lemmy_db_views_actor = { version = "=0.19.3", path = "./crates/db_views_actor" } lemmy_db_views_actor = { version = "=0.19.3", path = "./crates/db_views_actor" }
lemmy_db_views_moderator = { version = "=0.19.3", path = "./crates/db_views_moderator" } lemmy_db_views_moderator = { version = "=0.19.3", path = "./crates/db_views_moderator" }
activitypub_federation = { version = "0.5.1", default-features = false, features = [ activitypub_federation = { git = "https://github.com/LemmyNet/activitypub-federation-rust.git", branch = "debug-signed-fetch", default-features = false, features = [
"actix-web", "actix-web",
] } ] }
diesel = "2.1.4" diesel = "2.1.4"

View file

@ -9,21 +9,19 @@ use lemmy_db_schema::{
impl SiteView { impl SiteView {
pub async fn read_local(pool: &mut DbPool<'_>) -> Result<Self, Error> { pub async fn read_local(pool: &mut DbPool<'_>) -> Result<Self, Error> {
let conn = &mut get_conn(pool).await?; let conn = &mut get_conn(pool).await?;
Ok( site::table
site::table .inner_join(local_site::table)
.inner_join(local_site::table) .inner_join(
.inner_join( local_site_rate_limit::table.on(local_site::id.eq(local_site_rate_limit::local_site_id)),
local_site_rate_limit::table.on(local_site::id.eq(local_site_rate_limit::local_site_id)), )
) .inner_join(site_aggregates::table)
.inner_join(site_aggregates::table) .select((
.select(( site::all_columns,
site::all_columns, local_site::all_columns,
local_site::all_columns, local_site_rate_limit::all_columns,
local_site_rate_limit::all_columns, site_aggregates::all_columns,
site_aggregates::all_columns, ))
)) .first::<SiteView>(conn)
.first::<SiteView>(conn) .await
.await?,
)
} }
} }