mirror of
https://github.com/agersant/polaris
synced 2025-02-12 20:03:29 +00:00
Fixed a bug where playlists were overwriting each other
This commit is contained in:
parent
7654d49246
commit
e9010fd39d
1 changed files with 3 additions and 3 deletions
|
@ -74,7 +74,7 @@ pub fn list_playlists<T>(owner: &str, db: &T) -> Result<Vec<String>>
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn save_playlist<T>(name: &str, owner: &str, content: &Vec<String>, db: &T) -> Result<()>
|
pub fn save_playlist<T>(playlist_name: &str, owner: &str, content: &Vec<String>, db: &T) -> Result<()>
|
||||||
where T: ConnectionSource + VFSSource
|
where T: ConnectionSource + VFSSource
|
||||||
{
|
{
|
||||||
let user: User;
|
let user: User;
|
||||||
|
@ -96,7 +96,7 @@ pub fn save_playlist<T>(name: &str, owner: &str, content: &Vec<String>, db: &T)
|
||||||
|
|
||||||
// Create playlist
|
// Create playlist
|
||||||
new_playlist = NewPlaylist {
|
new_playlist = NewPlaylist {
|
||||||
name: name.into(),
|
name: playlist_name.into(),
|
||||||
owner: user.id,
|
owner: user.id,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -107,7 +107,7 @@ pub fn save_playlist<T>(name: &str, owner: &str, content: &Vec<String>, db: &T)
|
||||||
{
|
{
|
||||||
use self::playlists::dsl::*;
|
use self::playlists::dsl::*;
|
||||||
playlist = playlists
|
playlist = playlists
|
||||||
.filter(name.eq(name).and(owner.eq(user.id)))
|
.filter(name.eq(playlist_name).and(owner.eq(user.id)))
|
||||||
.get_result(connection.deref())?;
|
.get_result(connection.deref())?;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue