mirror of
https://github.com/agersant/polaris
synced 2024-12-03 18:19:09 +00:00
Fixed a bug where songs weren't sorted correctly in api/flatten
This commit is contained in:
parent
bd537b8134
commit
ad22a3529f
1 changed files with 2 additions and 0 deletions
|
@ -524,6 +524,7 @@ pub fn flatten<T>(db: &T, virtual_path: &Path) -> Result<Vec<Song>>
|
|||
let like_path = real_path.as_path().to_string_lossy().into_owned() + "%";
|
||||
let real_songs: Vec<Song> = songs
|
||||
.filter(path.like(&like_path))
|
||||
.order(path)
|
||||
.load(connection.deref())?;
|
||||
let virtual_songs = real_songs
|
||||
.into_iter()
|
||||
|
@ -662,6 +663,7 @@ fn test_flatten() {
|
|||
update(&db).unwrap();
|
||||
let results = flatten(&db, Path::new("root")).unwrap();
|
||||
assert_eq!(results.len(), 12);
|
||||
assert_eq!(results[0].title, Some("Above The Water".to_owned()));
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
|
Loading…
Reference in a new issue