From bea19bd0d756365a47b9fd18dd1801c3af689e26 Mon Sep 17 00:00:00 2001 From: Andrzej Rybczak Date: Sun, 22 Sep 2013 23:40:44 +0200 Subject: [PATCH] lastfm: queueJob: if old job is not finished, discard it and start new one --- src/lastfm.h | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/src/lastfm.h b/src/lastfm.h index 71260994..380c35f9 100644 --- a/src/lastfm.h +++ b/src/lastfm.h @@ -51,16 +51,12 @@ struct Lastfm: Screen, Tabbable virtual bool isMergable() OVERRIDE { return true; } template - bool queueJob(ServiceT service) + void queueJob(ServiceT service) { auto old_service = dynamic_cast(m_service.get()); // if the same service and arguments were used, leave old info if (old_service != nullptr && *old_service == service) - return true; - - // download in progress - if (m_worker.valid() && !m_worker.is_ready()) - return false; + return; m_service = std::make_shared(std::forward(service)); m_worker = boost::async(boost::launch::async, boost::bind(&LastFm::Service::fetch, m_service.get())); @@ -69,8 +65,6 @@ struct Lastfm: Screen, Tabbable w << "Fetching information..."; w.flush(); m_title = ToWString(m_service->name()); - - return true; } protected: