Constellation, Spacedust, Slingshot, UFOs: atproto crates and services for microcosm
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

fixes at-microcosm/links#24 for constellation /links/distinct-dids total is not distinct total

+12 -2
+12 -2
constellation/src/server/mod.rs
··· 274 274 .get_links(&query.target, &query.collection, &query.path, limit, until) 275 275 .map_err(|_| http::StatusCode::INTERNAL_SERVER_ERROR)?; 276 276 277 + let total = store 278 + .get_count(&query.target, &query.collection, &query.path) 279 + .map_err(|_| http::StatusCode::INTERNAL_SERVER_ERROR)?; 280 + 277 281 let cursor = paged.next.map(|next| { 278 282 ApiCursor { 279 283 version: paged.version, ··· 285 289 Ok(acceptable( 286 290 accept, 287 291 GetLinkItemsResponse { 288 - total: paged.version.0, 292 + total: total, 289 293 linking_records: paged.items, 290 294 cursor, 291 295 query: (*query).clone(), ··· 335 339 .get_distinct_dids(&query.target, &query.collection, &query.path, limit, until) 336 340 .map_err(|_| http::StatusCode::INTERNAL_SERVER_ERROR)?; 337 341 342 + let distinct_dids_total = store 343 + .get_distinct_did_count(&query.target, &query.collection, &query.path) 344 + .map_err(|_| http::StatusCode::INTERNAL_SERVER_ERROR)?; 345 + 346 + 347 + 338 348 let cursor = paged.next.map(|next| { 339 349 ApiCursor { 340 350 version: paged.version, ··· 346 356 Ok(acceptable( 347 357 accept, 348 358 GetDidItemsResponse { 349 - total: paged.version.0, 359 + total: distinct_dids_total, 350 360 linking_dids: paged.items, 351 361 cursor, 352 362 query: (*query).clone(),