summaryrefslogtreecommitdiff
path: root/src/lib/examine_content_job.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2025-07-15 02:19:35 +0200
committerCarl Hetherington <cth@carlh.net>2025-07-15 11:10:47 +0200
commit847daf7ec0f741eb6d50638c2096743ee731634c (patch)
tree8fba9c9571d0579151dcca8876cd22c5062825e6 /src/lib/examine_content_job.cc
parent66a6aea50054a5af8624c7d36949c642f4c8b619 (diff)
Change ExamineContentJob to take a vector of content.
Diffstat (limited to 'src/lib/examine_content_job.cc')
-rw-r--r--src/lib/examine_content_job.cc14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/lib/examine_content_job.cc b/src/lib/examine_content_job.cc
index 2466d8305..d12d736a7 100644
--- a/src/lib/examine_content_job.cc
+++ b/src/lib/examine_content_job.cc
@@ -29,14 +29,15 @@
#include "i18n.h"
-using std::string;
using std::cout;
using std::shared_ptr;
+using std::string;
+using std::vector;
-ExamineContentJob::ExamineContentJob(shared_ptr<const Film> film, shared_ptr<Content> content, bool tolerant)
+ExamineContentJob::ExamineContentJob(shared_ptr<const Film> film, vector<shared_ptr<Content>> content, bool tolerant)
: Job(film)
- , _content(content)
+ , _content(std::move(content))
, _tolerant(tolerant)
{
@@ -66,7 +67,12 @@ ExamineContentJob::json_name() const
void
ExamineContentJob::run()
{
- _content->examine(_film, shared_from_this(), _tolerant);
+ int n = 0;
+ for (auto c: _content) {
+ c->examine(_film, shared_from_this(), _tolerant);
+ set_progress(float(n) / _content.size());
+ ++n;
+ }
set_progress(1);
set_state(FINISHED_OK);
}