Merge pull request #26373 from ksooo/app-fix-multi-resolve-playback
[xbmc.git] / xbmc / music / jobs / MusicLibraryExportJob.cpp
blobca63d13290e96524f4b92cce35d5a8ad2a85ca72
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 "MusicLibraryExportJob.h"
11 #include "dialogs/GUIDialogProgress.h"
12 #include "music/MusicDatabase.h"
13 #include "settings/LibExportSettings.h"
15 CMusicLibraryExportJob::CMusicLibraryExportJob(const CLibExportSettings& settings, CGUIDialogProgress* progressDialog)
16 : CMusicLibraryProgressJob(NULL),
17 m_settings(settings)
19 if (progressDialog)
20 SetProgressIndicators(NULL, progressDialog);
21 SetAutoClose(true);
24 CMusicLibraryExportJob::~CMusicLibraryExportJob() = default;
26 bool CMusicLibraryExportJob::operator==(const CJob* job) const
28 if (strcmp(job->GetType(), GetType()) != 0)
29 return false;
31 const CMusicLibraryExportJob* exportJob = dynamic_cast<const CMusicLibraryExportJob*>(job);
32 if (exportJob == NULL)
33 return false;
35 return !(m_settings != exportJob->m_settings);
38 bool CMusicLibraryExportJob::Work(CMusicDatabase &db)
40 db.ExportToXML(m_settings, GetProgressDialog());
42 return true;