fix
This commit is contained in:
parent
ca45a6df02
commit
e5a2dfaade
2 changed files with 9 additions and 5 deletions
|
@ -5,7 +5,9 @@ use crate::{get_pg, library::user::User};
|
|||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize, FromRow)]
|
||||
pub struct Playlist {
|
||||
pub id: String,
|
||||
pub id: uuid::Uuid,
|
||||
#[sqlx(default)]
|
||||
pub id_str: Option<String>,
|
||||
pub owner: String,
|
||||
pub title: String,
|
||||
pub visibility: Visibility,
|
||||
|
@ -62,7 +64,7 @@ impl Playlist {
|
|||
impl Playlist {
|
||||
pub async fn api(&self) -> serde_json::Value {
|
||||
serde_json::json!({
|
||||
"id": self.id,
|
||||
"id": if let Some(id) = &self.id_str { id.clone() } else { self.id.to_string() },
|
||||
"owner": self.owner,
|
||||
"visibility": serde_json::to_value(&self.visibility).unwrap(),
|
||||
"title": self.title,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue