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:
Bryan Schumaker 2011-11-13 12:21:00 -05:00
parent 5512d46e4e
commit b36def4c08
3 changed files with 14 additions and 0 deletions

View File

@ -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 */

View File

@ -65,6 +65,8 @@ namespace libsaria
LibraryPath *get_path(string);
void rebuild_list();
void reindex();
bool is_filtered();
unsigned int filter_size();
}
}

View File

@ -148,6 +148,8 @@ namespace libsaria
unsigned int library::size()
{
if (is_filtered() == true)
return filter_size();
return play_list.size();
}