Merge pull request #26373 from ksooo/app-fix-multi-resolve-playback
[xbmc.git] / xbmc / music / jobs / MusicLibraryCleaningJob.cpp
blob43615667ba1e2d3f2917c85d142d1bda02506ef2
1 /*
2 * Copyright (C) 2017-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 #include "MusicLibraryCleaningJob.h"
11 #include "dialogs/GUIDialogProgress.h"
12 #include "music/MusicDatabase.h"
14 CMusicLibraryCleaningJob::CMusicLibraryCleaningJob(CGUIDialogProgress* progressDialog)
15 : CMusicLibraryProgressJob(nullptr)
17 if (progressDialog)
18 SetProgressIndicators(nullptr, progressDialog);
19 SetAutoClose(true);
22 CMusicLibraryCleaningJob::~CMusicLibraryCleaningJob() = default;
24 bool CMusicLibraryCleaningJob::operator==(const CJob* job) const
26 if (strcmp(job->GetType(), GetType()) != 0)
27 return false;
29 const CMusicLibraryCleaningJob* cleaningJob = dynamic_cast<const CMusicLibraryCleaningJob*>(job);
30 if (cleaningJob == nullptr)
31 return false;
33 return true;
36 bool CMusicLibraryCleaningJob::Work(CMusicDatabase &db)
38 db.Cleanup(GetProgressDialog());
39 return true;