h-gtk: Take into account the ignored_shows when detemening if podcast table is empty.

If you've had one show and pressed unsub, instead of going to
an empty view, it would stay to populated since it the db records
where still there.
This commit is contained in:
Jordan Petridis
2018-04-27 11:21:32 +03:00
parent 72a6832571
commit dc5ff9d809
4 changed files with 12 additions and 8 deletions
+2 -2
View File
@@ -363,13 +363,13 @@ pub fn is_episodes_populated() -> Result<bool, DataError> {
/// Check if the `podcast` table contains any rows
///
/// Return true if `podcast table is populated.
pub fn is_podcasts_populated() -> Result<bool, DataError> {
pub fn is_podcasts_populated(filter_ids: &[i32]) -> Result<bool, DataError> {
use schema::podcast::dsl::*;
let db = connection();
let con = db.get()?;
select(exists(podcast.as_query()))
select(exists(podcast.filter(id.ne_all(filter_ids))))
.get_result(&con)
.map_err(From::from)
}