playlists
This commit is contained in:
parent
edac4b1394
commit
f7dbb14a6b
4 changed files with 21 additions and 8 deletions
|
@ -278,11 +278,21 @@ impl Libary {
|
|||
.await
|
||||
.unwrap()
|
||||
{
|
||||
if Track::find_partial(doc! { "artist_id": artist.reference()}, json!({}), None, None)
|
||||
if Track::find_partial(
|
||||
doc! { "artist_id": artist.reference()},
|
||||
json!({}),
|
||||
None,
|
||||
None,
|
||||
)
|
||||
.await
|
||||
.unwrap()
|
||||
.is_empty()
|
||||
&& Album::find_partial(doc! { "artist_id": artist.reference()}, json!({}), None, None)
|
||||
&& Album::find_partial(
|
||||
doc! { "artist_id": artist.reference()},
|
||||
json!({}),
|
||||
None,
|
||||
None,
|
||||
)
|
||||
.await
|
||||
.unwrap()
|
||||
.is_empty()
|
||||
|
|
|
@ -90,7 +90,7 @@ impl Track {
|
|||
"album_id": None::<String>
|
||||
},
|
||||
None,
|
||||
None
|
||||
None,
|
||||
)
|
||||
.await
|
||||
.unwrap()
|
||||
|
|
|
@ -24,7 +24,7 @@ pub async fn get_singles_route(u: User) -> FallibleApiResponse {
|
|||
let singles = Track::find(
|
||||
doc! { "album_id": None::<String>, "artist_id": {"$ne": None::<String> }},
|
||||
None,
|
||||
None
|
||||
None,
|
||||
)
|
||||
.await
|
||||
.unwrap();
|
||||
|
|
|
@ -19,7 +19,10 @@ use super::ToAPI;
|
|||
|
||||
#[get("/playlists")]
|
||||
pub async fn playlists_route(u: User) -> FallibleApiResponse {
|
||||
let mut playlists = vec![json!({"id": "recent", "name": "Recently Played"})];
|
||||
let mut playlists = vec![
|
||||
json!({"id": "recent", "name": "Recently Played"}),
|
||||
json!({"id": "recentlyAdded", "name": "Recently Added"}),
|
||||
];
|
||||
|
||||
let own_playlists = Playlist::find(doc! { "owner": u.reference()}, None, None)
|
||||
.await
|
||||
|
|
Loading…
Reference in a new issue