libsaria: Change library size when filtered
I return the number of visible songs, so if the user has entered a filter string then I return the size of the results set. If we're not filtered then I return the size of the playlist.
This commit is contained in:
parent
5512d46e4e
commit
b36def4c08
|
@ -167,6 +167,11 @@ namespace libsaria
|
|||
trigger_callback(REFILTER);
|
||||
}
|
||||
|
||||
bool library::is_filtered()
|
||||
{
|
||||
return filtered;
|
||||
}
|
||||
|
||||
bool library::is_visible(ino_t &inode)
|
||||
{
|
||||
set<ino_t>::iterator it;
|
||||
|
@ -177,4 +182,9 @@ namespace libsaria
|
|||
return it != results.end();
|
||||
}
|
||||
|
||||
unsigned int library::filter_size()
|
||||
{
|
||||
return results.size();
|
||||
}
|
||||
|
||||
}; /* Namespace: libsaria */
|
||||
|
|
|
@ -65,6 +65,8 @@ namespace libsaria
|
|||
LibraryPath *get_path(string);
|
||||
void rebuild_list();
|
||||
void reindex();
|
||||
bool is_filtered();
|
||||
unsigned int filter_size();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -148,6 +148,8 @@ namespace libsaria
|
|||
|
||||
unsigned int library::size()
|
||||
{
|
||||
if (is_filtered() == true)
|
||||
return filter_size();
|
||||
return play_list.size();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue