mirror of
https://github.com/agersant/polaris
synced 2024-11-10 10:14:12 +00:00
Fixed a bug where browse results were not sorted alphabetically
This commit is contained in:
parent
9ee523f8e1
commit
55b49f1ace
1 changed files with 10 additions and 8 deletions
|
@ -128,21 +128,23 @@ impl DB {
|
|||
let real_path = self.vfs.virtual_to_real(virtual_path)?;
|
||||
let real_path_string = real_path.as_path().to_string_lossy().into_owned();
|
||||
|
||||
let real_songs: Vec<Song> = songs::table
|
||||
.filter(songs::columns::parent.eq(&real_path_string))
|
||||
.load(connection)?;
|
||||
let virtual_songs = real_songs
|
||||
.into_iter()
|
||||
.filter_map(|s| self.virtualize_song(s));
|
||||
output.extend(virtual_songs.map(|s| CollectionFile::Song(s)));
|
||||
|
||||
let real_directories: Vec<Directory> = directories::table
|
||||
.filter(directories::columns::parent.eq(&real_path_string))
|
||||
.order(directories::columns::path)
|
||||
.load(connection)?;
|
||||
let virtual_directories = real_directories
|
||||
.into_iter()
|
||||
.filter_map(|s| self.virtualize_directory(s));
|
||||
output.extend(virtual_directories.map(|d| CollectionFile::Directory(d)));
|
||||
|
||||
let real_songs: Vec<Song> = songs::table
|
||||
.filter(songs::columns::parent.eq(&real_path_string))
|
||||
.order(songs::columns::path)
|
||||
.load(connection)?;
|
||||
let virtual_songs = real_songs
|
||||
.into_iter()
|
||||
.filter_map(|s| self.virtualize_song(s));
|
||||
output.extend(virtual_songs.map(|s| CollectionFile::Song(s)));
|
||||
}
|
||||
|
||||
Ok(output)
|
||||
|
|
Loading…
Reference in a new issue