Update to support latest navidrome version
This commit is contained in:
1 parent
558c79d0cb
commit
bc8d9908d1
9 files changed
+375
-323
No files matched your search
+11
-17
@@ -15,9 +15,7 @@ use rocket::serde::json::{json, Json};
|
||||
use rocket::{get, post, routes, serde::json::Value as JsonValue, State};
|
||||
use serde::{Deserialize, Serialize};
|
||||
use sqlx::postgres::PgPool;
|
||||
use std::str::FromStr;
|
||||
use std::sync::{Arc, OnceLock};
|
||||
use uuid::Uuid;
|
||||
|
||||
pub static CONFIG: OnceLock<Config> = OnceLock::new();
|
||||
|
||||
@@ -140,23 +138,19 @@ async fn create_tracking_playlist(
|
||||
.create_playlist(create_playlist.playlist_name.clone())
|
||||
.await
|
||||
{
|
||||
Ok(created_playlist) => match Uuid::from_str(&created_playlist.id) {
|
||||
Ok(playlist_id) => {
|
||||
let partial = PartialTrackedPlaylist {
|
||||
playlist_id,
|
||||
playlist_size: create_playlist.playlist_size,
|
||||
tracking_user: create_playlist.tracking_user.clone(),
|
||||
tracking_type: create_playlist.tracking_type.clone(),
|
||||
};
|
||||
Ok(created_playlist) => {
|
||||
let partial = PartialTrackedPlaylist {
|
||||
playlist_id: created_playlist.id,
|
||||
playlist_size: create_playlist.playlist_size,
|
||||
tracking_user: create_playlist.tracking_user.clone(),
|
||||
tracking_type: create_playlist.tracking_type.clone(),
|
||||
};
|
||||
|
||||
match partial.record(pool.inner()).await {
|
||||
Ok(playlist) => Json(Response::Success(playlist)),
|
||||
Err(e) => Json(Response::Error(e.into())),
|
||||
}
|
||||
match partial.record(pool.inner()).await {
|
||||
Ok(playlist) => Json(Response::Success(playlist)),
|
||||
Err(e) => Json(Response::Error(e.into())),
|
||||
}
|
||||
|
||||
Err(e) => Json(Response::Error(e.into())),
|
||||
},
|
||||
}
|
||||
|
||||
Err(_) => Json(Response::Error(JsonError {
|
||||
error: "Couldn't create Subsonic playlist".to_string(),
|
||||
|
||||
Reference in new issue
Block a user