xbmc
VideoLibraryScanningJob.h
1 /*
2  * Copyright (C) 2014-2018 Team Kodi
3  * This file is part of Kodi - https://kodi.tv
4  *
5  * SPDX-License-Identifier: GPL-2.0-or-later
6  * See LICENSES/README.md for more information.
7  */
8 
9 #pragma once
10 
11 #include "video/VideoInfoScanner.h"
12 #include "video/jobs/VideoLibraryJob.h"
13 
14 #include <string>
15 
23 {
24 public:
32  CVideoLibraryScanningJob(const std::string& directory, bool scanAll = false, bool showProgress = true);
33  ~CVideoLibraryScanningJob() override;
34 
35  // specialization of CVideoLibraryJob
36  bool CanBeCancelled() const override { return true; }
37  bool Cancel() override;
38 
39  // specialization of CJob
40  const char *GetType() const override { return "VideoLibraryScanningJob"; }
41  bool operator==(const CJob* job) const override;
42 
43 protected:
44  // implementation of CVideoLibraryJob
45  bool Work(CVideoDatabase &db) override;
46 
47 private:
48  VIDEO::CVideoInfoScanner m_scanner;
49  std::string m_directory;
50  bool m_showProgress;
51  bool m_scanAll;
52 };
bool Work(CVideoDatabase &db) override
Worker method to be implemented by an actual implementation.
Definition: VideoLibraryScanningJob.cpp:44
Base class for jobs that are executed asynchronously.
Definition: Job.h:109
Definition: VideoInfoScanner.h:47
Basic implementation/interface of a CJob which interacts with the video database. ...
Definition: VideoLibraryJob.h:19
Definition: VideoDatabase.h:395
bool Cancel() override
Tries to cancel the running job.
Definition: VideoLibraryScanningJob.cpp:22
CVideoLibraryScanningJob(const std::string &directory, bool scanAll=false, bool showProgress=true)
Creates a new video library scanning job.
Definition: VideoLibraryScanningJob.cpp:13
bool CanBeCancelled() const override
Whether the job can be cancelled or not.
Definition: VideoLibraryScanningJob.h:36
const char * GetType() const override
Function that returns the type of job.
Definition: VideoLibraryScanningJob.h:40
Video library job implementation for scanning items.
Definition: VideoLibraryScanningJob.h:22