Merge pull request #26287 from CrystalP/ref-savefilestatejob
[xbmc.git] / xbmc / video / jobs / VideoLibraryScanningJob.h
blobf7233799cd50a35150e2c830e6ef3aeeea2d144c
1 /*
2 * Copyright (C) 2014-2018 Team Kodi
3 * This file is part of Kodi - https://kodi.tv
5 * SPDX-License-Identifier: GPL-2.0-or-later
6 * See LICENSES/README.md for more information.
7 */
9 #pragma once
11 #include "video/VideoInfoScanner.h"
12 #include "video/jobs/VideoLibraryJob.h"
14 #include <string>
16 /*!
17 \brief Video library job implementation for scanning items.
19 Uses CVideoInfoScanner for the whole filesystem scanning and can be run with
20 or without a visible progress bar.
22 class CVideoLibraryScanningJob : public CVideoLibraryJob
24 public:
25 /*!
26 \brief Creates a new video library scanning job.
28 \param[in] directory Directory to be scanned for new items
29 \param[in] scanAll Whether to scan all items or not
30 \param[in] showProgress Whether to show a progress bar or not
32 CVideoLibraryScanningJob(const std::string& directory, bool scanAll = false, bool showProgress = true);
33 ~CVideoLibraryScanningJob() override;
35 // specialization of CVideoLibraryJob
36 bool CanBeCancelled() const override { return true; }
37 bool Cancel() override;
39 // specialization of CJob
40 const char *GetType() const override { return "VideoLibraryScanningJob"; }
41 bool operator==(const CJob* job) const override;
43 protected:
44 // implementation of CVideoLibraryJob
45 bool Work(CVideoDatabase &db) override;
47 private:
48 KODI::VIDEO::CVideoInfoScanner m_scanner;
49 std::string m_directory;
50 bool m_showProgress;
51 bool m_scanAll;