A decentralized music tracking and discovery platform built on AT Protocol 🎵

[scrobbler] fix listenbrainz api

+14 -3
+3 -3
crates/scrobbler/src/repo/user.rs
··· 1 1 use anyhow::Error; 2 2 use sqlx::{Pool, Postgres}; 3 3 4 - use crate::xata::user::User; 4 + use crate::xata::user::{User, UserWithoutSecret}; 5 5 6 6 7 7 pub async fn get_user_by_apikey(pool: &Pool<Postgres>, apikey: &str) -> Result<Option<User>, Error> { ··· 22 22 } 23 23 24 24 25 - pub async fn get_user_by_did(pool: &Pool<Postgres>, did: &str) -> Result<Option<User>, Error> { 26 - let results: Vec<User> = sqlx::query_as(r#" 25 + pub async fn get_user_by_did(pool: &Pool<Postgres>, did: &str) -> Result<Option<UserWithoutSecret>, Error> { 26 + let results: Vec<UserWithoutSecret> = sqlx::query_as(r#" 27 27 SELECT * FROM users 28 28 WHERE did = $1 29 29 "#)
+11
crates/scrobbler/src/xata/user.rs
··· 12 12 #[serde(with = "chrono::serde::ts_seconds")] 13 13 pub xata_createdat: DateTime<Utc>, 14 14 } 15 + 16 + #[derive(Debug, sqlx::FromRow, Serialize, Deserialize, Clone)] 17 + pub struct UserWithoutSecret { 18 + pub xata_id: String, 19 + pub display_name: String, 20 + pub did: String, 21 + pub handle: String, 22 + pub avatar: String, 23 + #[serde(with = "chrono::serde::ts_seconds")] 24 + pub xata_createdat: DateTime<Utc>, 25 + }