From 6402db2a386a7b1f89fc2fd0067b9fd16ee8cc24 Mon Sep 17 00:00:00 2001 From: montellese Date: Sat, 15 Nov 2014 10:13:43 +0100 Subject: [PATCH 01/13] videodb: cleanup paramters of CleanDatabase() --- xbmc/Application.cpp | 5 ++++- xbmc/video/VideoDatabase.cpp | 13 +++---------- xbmc/video/VideoDatabase.h | 2 +- xbmc/video/VideoInfoScanner.cpp | 7 ++++--- xbmc/video/VideoInfoScanner.h | 2 +- 5 files changed, 13 insertions(+), 16 deletions(-) diff --git a/xbmc/Application.cpp b/xbmc/Application.cpp index 0f09193b01255..d8f5fa382fbd5 100644 --- a/xbmc/Application.cpp +++ b/xbmc/Application.cpp @@ -4978,7 +4978,10 @@ void CApplication::StartVideoCleanup(bool userInitiated /* = true */) return; if (userInitiated) - m_videoInfoScanner->CleanDatabase(NULL, NULL, true); + { + std::set paths; + m_videoInfoScanner->CleanDatabase(NULL, paths, userInitiated); + } else { m_videoInfoScanner->ShowDialog(false); diff --git a/xbmc/video/VideoDatabase.cpp b/xbmc/video/VideoDatabase.cpp index 4346379f91dd2..f862563ab7fdd 100644 --- a/xbmc/video/VideoDatabase.cpp +++ b/xbmc/video/VideoDatabase.cpp @@ -7816,7 +7816,7 @@ void CVideoDatabase::GetMusicVideoDirectorsByName(const std::string& strSearch, } } -void CVideoDatabase::CleanDatabase(CGUIDialogProgressBarHandle* handle, const set* paths, bool showProgress) +void CVideoDatabase::CleanDatabase(CGUIDialogProgressBarHandle* handle, const set& paths, bool showProgress) { CGUIDialogProgress *progress=NULL; try @@ -7832,17 +7832,10 @@ void CVideoDatabase::CleanDatabase(CGUIDialogProgressBarHandle* handle, const se // find all the files std::string sql = "SELECT files.idFile, files.strFileName, path.strPath FROM files, path WHERE files.idPath = path.idPath"; - if (paths) + if (!paths.empty()) { - if (paths->empty()) - { - RollbackTransaction(); - ANNOUNCEMENT::CAnnouncementManager::Get().Announce(ANNOUNCEMENT::VideoLibrary, "xbmc", "OnCleanFinished"); - return; - } - std::string strPaths; - for (std::set::const_iterator it = paths->begin(); it != paths->end(); ++it) + for (std::set::const_iterator it = paths.begin(); it != paths.end(); ++it) strPaths += StringUtils::Format(",%i", *it); sql += PrepareSQL(" AND path.idPath IN (%s)", strPaths.substr(1).c_str()); } diff --git a/xbmc/video/VideoDatabase.h b/xbmc/video/VideoDatabase.h index fcab0a865d9ad..8942b439f4784 100644 --- a/xbmc/video/VideoDatabase.h +++ b/xbmc/video/VideoDatabase.h @@ -668,7 +668,7 @@ class CVideoDatabase : public CDatabase bool HasContent(VIDEODB_CONTENT_TYPE type); bool HasSets() const; - void CleanDatabase(CGUIDialogProgressBarHandle* handle=NULL, const std::set* paths=NULL, bool showProgress=true); + void CleanDatabase(CGUIDialogProgressBarHandle* handle = NULL, const std::set& paths = std::set(), bool showProgress = true); /*! \brief Add a file to the database, if necessary If the file is already in the database, we simply return its id. diff --git a/xbmc/video/VideoInfoScanner.cpp b/xbmc/video/VideoInfoScanner.cpp index b7244a1fd04ea..ce25e7b2d8163 100644 --- a/xbmc/video/VideoInfoScanner.cpp +++ b/xbmc/video/VideoInfoScanner.cpp @@ -89,7 +89,8 @@ namespace VIDEO // check if we only need to perform a cleaning if (m_bClean && m_pathsToScan.empty()) { - CleanDatabase(m_handle, NULL, false); + std::set paths; + CleanDatabase(m_handle, paths, false); if (m_handle) m_handle->MarkFinished(); @@ -147,7 +148,7 @@ namespace VIDEO if (!bCancelled) { if (m_bClean) - CleanDatabase(m_handle,&m_pathsToClean, false); + CleanDatabase(m_handle, m_pathsToClean, false); else { if (m_handle) @@ -244,7 +245,7 @@ namespace VIDEO StopThread(false); } - void CVideoInfoScanner::CleanDatabase(CGUIDialogProgressBarHandle* handle /*= NULL */, const set* paths /*= NULL */, bool showProgress /*= true */) + void CVideoInfoScanner::CleanDatabase(CGUIDialogProgressBarHandle* handle /* = NULL */, const set& paths /* = set */, bool showProgress /* = true */) { m_bRunning = true; m_database.Open(); diff --git a/xbmc/video/VideoInfoScanner.h b/xbmc/video/VideoInfoScanner.h index af63b1e7b3646..7d97cbc1c9d1a 100644 --- a/xbmc/video/VideoInfoScanner.h +++ b/xbmc/video/VideoInfoScanner.h @@ -61,7 +61,7 @@ namespace VIDEO void Start(const std::string& strDirectory, bool scanAll = false); void StartCleanDatabase(); bool IsScanning(); - void CleanDatabase(CGUIDialogProgressBarHandle* handle=NULL, const std::set* paths=NULL, bool showProgress=true); + void CleanDatabase(CGUIDialogProgressBarHandle* handle = NULL, const std::set& paths = std::set(), bool showProgress = true); void Stop(); //! \brief Set whether or not to show a progress dialog From de0992be3355350172ff9eacc5d5fed99052f906 Mon Sep 17 00:00:00 2001 From: montellese Date: Sat, 15 Nov 2014 10:41:47 +0100 Subject: [PATCH 02/13] CJobQueue: add IsProcessing() --- xbmc/utils/JobManager.cpp | 4 ++++ xbmc/utils/JobManager.h | 5 +++++ 2 files changed, 9 insertions(+) diff --git a/xbmc/utils/JobManager.cpp b/xbmc/utils/JobManager.cpp index 8f690fe636965..5207a1feac3a3 100644 --- a/xbmc/utils/JobManager.cpp +++ b/xbmc/utils/JobManager.cpp @@ -159,6 +159,10 @@ void CJobQueue::CancelJobs() m_processing.clear(); } +bool CJobQueue::IsProcessing() const +{ + return !m_processing.empty() || !m_jobQueue.empty(); +} bool CJobQueue::QueueEmpty() const { diff --git a/xbmc/utils/JobManager.h b/xbmc/utils/JobManager.h index 1df2287207364..b06d0bbf7b054 100644 --- a/xbmc/utils/JobManager.h +++ b/xbmc/utils/JobManager.h @@ -120,6 +120,11 @@ class CJobQueue: public IJobCallback */ void CancelJobs(); + /*! + \brief Check whether the queue is processing a job + */ + bool IsProcessing() const; + /*! \brief The callback used when a job completes. From c036a0609e6ae60b8f749fbc6fa6370766fa2af3 Mon Sep 17 00:00:00 2001 From: montellese Date: Sat, 31 Jan 2015 19:13:42 +0100 Subject: [PATCH 03/13] CJobQueue: add boolean return value to AddJob() --- xbmc/utils/JobManager.cpp | 6 ++++-- xbmc/utils/JobManager.h | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/xbmc/utils/JobManager.cpp b/xbmc/utils/JobManager.cpp index 5207a1feac3a3..b452e0a67d638 100644 --- a/xbmc/utils/JobManager.cpp +++ b/xbmc/utils/JobManager.cpp @@ -120,7 +120,7 @@ void CJobQueue::CancelJob(const CJob *job) } } -void CJobQueue::AddJob(CJob *job) +bool CJobQueue::AddJob(CJob *job) { CSingleLock lock(m_section); // check if we have this job already. If so, we're done. @@ -128,7 +128,7 @@ void CJobQueue::AddJob(CJob *job) find(m_processing.begin(), m_processing.end(), job) != m_processing.end()) { delete job; - return; + return false; } if (m_lifo) @@ -136,6 +136,8 @@ void CJobQueue::AddJob(CJob *job) else m_jobQueue.push_front(CJobPointer(job)); QueueNextJob(); + + return true; } void CJobQueue::QueueNextJob() diff --git a/xbmc/utils/JobManager.h b/xbmc/utils/JobManager.h index b06d0bbf7b054..f563bd6af419c 100644 --- a/xbmc/utils/JobManager.h +++ b/xbmc/utils/JobManager.h @@ -100,7 +100,7 @@ class CJobQueue: public IJobCallback \param job a pointer to the job to add. The job should be subclassed from CJob. \sa CJob */ - void AddJob(CJob *job); + bool AddJob(CJob *job); /*! \brief Cancel a job in the queue From 914236b8337b9bb1a2214b3dbee42cb5bf0712d5 Mon Sep 17 00:00:00 2001 From: montellese Date: Sat, 31 Jan 2015 16:39:25 +0100 Subject: [PATCH 04/13] utils: add CProgressJob --- xbmc/utils/Makefile.in | 1 + xbmc/utils/ProgressJob.cpp | 75 ++++++++++++++++++++++++++++++++++++++ xbmc/utils/ProgressJob.h | 51 ++++++++++++++++++++++++++ 3 files changed, 127 insertions(+) create mode 100644 xbmc/utils/ProgressJob.cpp create mode 100644 xbmc/utils/ProgressJob.h diff --git a/xbmc/utils/Makefile.in b/xbmc/utils/Makefile.in index a5ca1806390cb..d7a2b718295de 100644 --- a/xbmc/utils/Makefile.in +++ b/xbmc/utils/Makefile.in @@ -48,6 +48,7 @@ SRCS += PerformanceSample.cpp SRCS += PerformanceStats.cpp SRCS += posix/PosixInterfaceForCLog.cpp SRCS += POUtils.cpp +SRCS += ProgressJob.cpp SRCS += RecentlyAddedJob.cpp SRCS += RegExp.cpp SRCS += RingBuffer.cpp diff --git a/xbmc/utils/ProgressJob.cpp b/xbmc/utils/ProgressJob.cpp new file mode 100644 index 0000000000000..a3a2885003dfb --- /dev/null +++ b/xbmc/utils/ProgressJob.cpp @@ -0,0 +1,75 @@ +/* + * Copyright (C) 2015 Team XBMC + * http://xbmc.org + * + * This Program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This Program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with XBMC; see the file COPYING. If not, see + * . + * + */ + +#include "ProgressJob.h" +#include "dialogs/GUIDialogExtendedProgressBar.h" + +using namespace std; + +CProgressJob::CProgressJob(CGUIDialogProgressBarHandle* progressBar) + : m_progress(progressBar) +{ } + +CProgressJob::~CProgressJob() +{ + MarkFinished(); + + m_progress = NULL; +} + +void CProgressJob::SetTitle(const std::string &title) +{ + if (m_progress == NULL) + return; + + m_progress->SetTitle(title); +} + +void CProgressJob::SetText(const std::string &text) +{ + if (m_progress == NULL) + return; + + m_progress->SetText(text); +} + +void CProgressJob::SetProgress(float percentage) +{ + if (m_progress == NULL) + return; + + m_progress->SetPercentage(percentage); +} + +void CProgressJob::SetProgress(int currentStep, int totalSteps) +{ + if (m_progress == NULL) + return; + + m_progress->SetProgress(currentStep, totalSteps); +} + +void CProgressJob::MarkFinished() +{ + if (m_progress == NULL) + return; + + m_progress->MarkFinished(); +} diff --git a/xbmc/utils/ProgressJob.h b/xbmc/utils/ProgressJob.h new file mode 100644 index 0000000000000..35a7b28d5da1e --- /dev/null +++ b/xbmc/utils/ProgressJob.h @@ -0,0 +1,51 @@ +#pragma once +/* + * Copyright (C) 2015 Team XBMC + * http://xbmc.org + * + * This Program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This Program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with XBMC; see the file COPYING. If not, see + * . + * + */ + +#include + +#include "utils/Job.h" + +class CGUIDialogProgressBarHandle; + +class CProgressJob : public CJob +{ +public: + virtual ~CProgressJob(); + + // implementation of CJob + virtual const char *GetType() const { return "ProgressJob"; } + virtual bool operator==(const CJob* job) const { return false; } + +protected: + CProgressJob(CGUIDialogProgressBarHandle* progressBar); + + CGUIDialogProgressBarHandle* GetProgressBar() { return m_progress; } + + void SetTitle(const std::string &title); + void SetText(const std::string &text); + + void SetProgress(float percentage); + void SetProgress(int currentStep, int totalSteps); + void MarkFinished(); + +private: + CGUIDialogProgressBarHandle* m_progress; +}; From 77027837861b1b218ce6bd273de263d4bf0c4d5f Mon Sep 17 00:00:00 2001 From: montellese Date: Sat, 15 Nov 2014 10:21:38 +0100 Subject: [PATCH 05/13] video library: add CVideoLibraryQueue and CVideoLibraryJob --- Makefile.in | 1 + xbmc/video/Makefile | 1 + xbmc/video/VideoLibraryQueue.cpp | 122 ++++++++++++++++++++++++++++ xbmc/video/VideoLibraryQueue.h | 56 +++++++++++++ xbmc/video/jobs/Makefile | 6 ++ xbmc/video/jobs/VideoLibraryJob.cpp | 39 +++++++++ xbmc/video/jobs/VideoLibraryJob.h | 43 ++++++++++ 7 files changed, 268 insertions(+) create mode 100644 xbmc/video/VideoLibraryQueue.cpp create mode 100644 xbmc/video/VideoLibraryQueue.h create mode 100644 xbmc/video/jobs/Makefile create mode 100644 xbmc/video/jobs/VideoLibraryJob.cpp create mode 100644 xbmc/video/jobs/VideoLibraryJob.h diff --git a/Makefile.in b/Makefile.in index 6539711c051c4..0c6ad606fa53a 100644 --- a/Makefile.in +++ b/Makefile.in @@ -92,6 +92,7 @@ DIRECTORY_ARCHIVES=$(DVDPLAYER_ARCHIVES) \ xbmc/storage/storage.a \ xbmc/utils/utils.a \ xbmc/video/dialogs/videodialogs.a \ + xbmc/video/jobs/video-jobs.a \ xbmc/video/videosync/videosync.a \ xbmc/video/video.a \ xbmc/video/windows/videowindows.a \ diff --git a/xbmc/video/Makefile b/xbmc/video/Makefile index 45b29c642f79f..9c2484262cdb6 100644 --- a/xbmc/video/Makefile +++ b/xbmc/video/Makefile @@ -8,6 +8,7 @@ SRCS=Bookmark.cpp \ VideoInfoDownloader.cpp \ VideoInfoScanner.cpp \ VideoInfoTag.cpp \ + VideoLibraryQueue.cpp \ VideoReferenceClock.cpp \ VideoThumbLoader.cpp \ diff --git a/xbmc/video/VideoLibraryQueue.cpp b/xbmc/video/VideoLibraryQueue.cpp new file mode 100644 index 0000000000000..73353e9ce3546 --- /dev/null +++ b/xbmc/video/VideoLibraryQueue.cpp @@ -0,0 +1,122 @@ +/* + * Copyright (C) 2014 Team XBMC + * http://xbmc.org + * + * This Program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This Program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with XBMC; see the file COPYING. If not, see + * . + * + */ + +#include "VideoLibraryQueue.h" +#include "GUIUserMessages.h" +#include "Util.h" +#include "guilib/GUIWindowManager.h" +#include "threads/SingleLock.h" +#include "video/VideoDatabase.h" +#include "video/jobs/VideoLibraryJob.h" + +using namespace std; + +CVideoLibraryQueue::CVideoLibraryQueue() + : CJobQueue(false, 1, CJob::PRIORITY_LOW_PAUSABLE), + m_jobs() +{ } + +CVideoLibraryQueue::~CVideoLibraryQueue() +{ + CSingleLock lock(m_critical); + m_jobs.clear(); +} + +CVideoLibraryQueue& CVideoLibraryQueue::Get() +{ + static CVideoLibraryQueue s_instance; + return s_instance; +} + +void CVideoLibraryQueue::AddJob(CVideoLibraryJob *job) +{ + if (job == NULL) + return; + + CSingleLock lock(m_critical); + if (!CJobQueue::AddJob(job)) + return; + + // add the job to our list of queued/running jobs + std::string jobType = job->GetType(); + VideoLibraryJobMap::iterator jobsIt = m_jobs.find(jobType); + if (jobsIt == m_jobs.end()) + { + VideoLibraryJobs jobs; + jobs.insert(job); + m_jobs.insert(std::make_pair(jobType, jobs)); + } + else + jobsIt->second.insert(job); +} + +void CVideoLibraryQueue::CancelJob(CVideoLibraryJob *job) +{ + if (job == NULL) + return; + + CSingleLock lock(m_critical); + if (job->CanBeCancelled()) + job->Cancel(); + + CJobQueue::CancelJob(job); + + // remove the job from our list of queued/running jobs + VideoLibraryJobMap::iterator jobsIt = m_jobs.find(job->GetType()); + if (jobsIt != m_jobs.end()) + jobsIt->second.erase(job); +} + +void CVideoLibraryQueue::CancelAllJobs() +{ + CSingleLock lock(m_critical); + CJobQueue::CancelJobs(); + + // remove all scanning jobs + m_jobs.clear(); +} + +bool CVideoLibraryQueue::IsRunning() const +{ + return CJobQueue::IsProcessing(); +} + +void CVideoLibraryQueue::OnJobComplete(unsigned int jobID, bool success, CJob *job) +{ + if (success) + { + if (QueueEmpty()) + { + CUtil::DeleteVideoDatabaseDirectoryCache(); + CGUIMessage msg(GUI_MSG_NOTIFY_ALL, 0, 0, GUI_MSG_UPDATE); + g_windowManager.SendThreadMessage(msg); + } + } + + { + CSingleLock lock(m_critical); + // remove the job from our list of queued/running jobs + VideoLibraryJobMap::iterator jobsIt = m_jobs.find(job->GetType()); + if (jobsIt != m_jobs.end()) + jobsIt->second.erase(static_cast(job)); + } + + return CJobQueue::OnJobComplete(jobID, success, job); +} diff --git a/xbmc/video/VideoLibraryQueue.h b/xbmc/video/VideoLibraryQueue.h new file mode 100644 index 0000000000000..97334472c6a06 --- /dev/null +++ b/xbmc/video/VideoLibraryQueue.h @@ -0,0 +1,56 @@ +#pragma once +/* + * Copyright (C) 2014 Team XBMC + * http://xbmc.org + * + * This Program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This Program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with XBMC; see the file COPYING. If not, see + * . + * + */ + +#include +#include + +#include "threads/CriticalSection.h" +#include "utils/JobManager.h" + +class CVideoLibraryJob; + +class CVideoLibraryQueue : protected CJobQueue +{ +public: + ~CVideoLibraryQueue(); + + static CVideoLibraryQueue& Get(); + + void AddJob(CVideoLibraryJob *job); + void CancelJob(CVideoLibraryJob *job); + void CancelAllJobs(); + + bool IsRunning() const; + +protected: + // implementation of IJobCallback + virtual void OnJobComplete(unsigned int jobID, bool success, CJob *job); + +private: + CVideoLibraryQueue(); + CVideoLibraryQueue(const CVideoLibraryQueue&); + CVideoLibraryQueue const& operator=(CVideoLibraryQueue const&); + + typedef std::set VideoLibraryJobs; + typedef std::map VideoLibraryJobMap; + VideoLibraryJobMap m_jobs; + CCriticalSection m_critical; +}; diff --git a/xbmc/video/jobs/Makefile b/xbmc/video/jobs/Makefile new file mode 100644 index 0000000000000..6834b78d92466 --- /dev/null +++ b/xbmc/video/jobs/Makefile @@ -0,0 +1,6 @@ +SRCS=VideoLibraryJob.cpp + +LIB=video-jobs.a + +include ../../../Makefile.include +-include $(patsubst %.cpp,%.P,$(patsubst %.c,%.P,$(SRCS))) diff --git a/xbmc/video/jobs/VideoLibraryJob.cpp b/xbmc/video/jobs/VideoLibraryJob.cpp new file mode 100644 index 0000000000000..ad6f81bcee6aa --- /dev/null +++ b/xbmc/video/jobs/VideoLibraryJob.cpp @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2014 Team XBMC + * http://xbmc.org + * + * This Program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This Program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with XBMC; see the file COPYING. If not, see + * . + * + */ + +#include "VideoLibraryJob.h" +#include "video/VideoDatabase.h" + +using namespace std; + +CVideoLibraryJob::CVideoLibraryJob() +{ } + +CVideoLibraryJob::~CVideoLibraryJob() +{ } + +bool CVideoLibraryJob::DoWork() +{ + CVideoDatabase db; + if (!db.Open()) + return false; + + return Work(db); +} diff --git a/xbmc/video/jobs/VideoLibraryJob.h b/xbmc/video/jobs/VideoLibraryJob.h new file mode 100644 index 0000000000000..502ddbcc78842 --- /dev/null +++ b/xbmc/video/jobs/VideoLibraryJob.h @@ -0,0 +1,43 @@ +#pragma once +/* + * Copyright (C) 2014 Team XBMC + * http://xbmc.org + * + * This Program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This Program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with XBMC; see the file COPYING. If not, see + * . + * + */ + +#include "utils/Job.h" + +class CVideoDatabase; + +class CVideoLibraryJob : public CJob +{ +public: + virtual ~CVideoLibraryJob(); + + virtual bool CanBeCancelled() const { return false; } + virtual bool Cancel() { return false; } + + // implementation of CJob + virtual bool DoWork(); + virtual const char *GetType() const { return "VideoLibraryJob"; } + virtual bool operator==(const CJob* job) const { return false; } + +protected: + CVideoLibraryJob(); + + virtual bool Work(CVideoDatabase &db) = 0; +}; From 55ce04778ca2ac144b66f1d00e7b58795247743c Mon Sep 17 00:00:00 2001 From: montellese Date: Sat, 15 Nov 2014 10:24:21 +0100 Subject: [PATCH 06/13] video library: move CMarkWatchedJob to CVideoLibraryMarkWatchedJob and use CVideoLibraryQueue --- xbmc/utils/Makefile.in | 1 - xbmc/utils/MarkWatchedJob.cpp | 135 ------------------ xbmc/video/VideoLibraryQueue.cpp | 9 ++ xbmc/video/VideoLibraryQueue.h | 3 + xbmc/video/jobs/Makefile | 3 +- .../video/jobs/VideoLibraryMarkWatchedJob.cpp | 105 ++++++++++++++ .../jobs/VideoLibraryMarkWatchedJob.h} | 28 ++-- xbmc/windows/GUIMediaWindow.cpp | 4 +- 8 files changed, 133 insertions(+), 155 deletions(-) delete mode 100644 xbmc/utils/MarkWatchedJob.cpp create mode 100644 xbmc/video/jobs/VideoLibraryMarkWatchedJob.cpp rename xbmc/{utils/MarkWatchedJob.h => video/jobs/VideoLibraryMarkWatchedJob.h} (65%) diff --git a/xbmc/utils/Makefile.in b/xbmc/utils/Makefile.in index d7a2b718295de..53e72084afb1d 100644 --- a/xbmc/utils/Makefile.in +++ b/xbmc/utils/Makefile.in @@ -41,7 +41,6 @@ SRCS += LangCodeExpander.cpp SRCS += LegacyPathTranslation.cpp SRCS += log.cpp SRCS += md5.cpp -SRCS += MarkWatchedJob.cpp SRCS += Mime.cpp SRCS += Observer.cpp SRCS += PerformanceSample.cpp diff --git a/xbmc/utils/MarkWatchedJob.cpp b/xbmc/utils/MarkWatchedJob.cpp deleted file mode 100644 index 054da5c124a2a..0000000000000 --- a/xbmc/utils/MarkWatchedJob.cpp +++ /dev/null @@ -1,135 +0,0 @@ -/* - * Copyright (C) 2014 Team XBMC - * http://xbmc.org - * - * This Program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This Program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with XBMC; see the file COPYING. If not, see - * . - * - */ - -#include "FileItem.h" -#include "filesystem/Directory.h" -#include "GUIUserMessages.h" -#include "guilib/GUIWindowManager.h" -#include "MarkWatchedJob.h" -#include "profiles/ProfilesManager.h" -#include "Util.h" -#include "utils/URIUtils.h" -#include "video/VideoDatabase.h" - -#ifdef HAS_UPNP -#include "network/upnp/UPnP.h" -#endif - -#include - -CMarkWatchedJob::CMarkWatchedJob(const CFileItemPtr &item, bool bMark) -{ - m_item = item; - m_bMark = bMark; -} - -CMarkWatchedJob::~CMarkWatchedJob() -{ -} - -bool CMarkWatchedJob::operator==(const CJob* job) const -{ - if (strcmp(job->GetType(), GetType()) == 0) - { - const CMarkWatchedJob* markJob = dynamic_cast(job); - if (markJob) - return (m_item->IsSamePath(markJob->m_item.get()) && markJob->m_bMark == m_bMark); - } - return false; -} - -bool CMarkWatchedJob::DoWork() -{ - if (!CProfilesManager::Get().GetCurrentProfile().canWriteDatabases()) - return false; - - CFileItemList items; - items.Add(CFileItemPtr(new CFileItem(*m_item))); - - if (m_item->m_bIsFolder) - CUtil::GetRecursiveListing(m_item->GetPath(), items, "", XFILE::DIR_FLAG_NO_FILE_INFO); - - std::vector markItems; - for (int i = 0; i < items.Size(); i++) - { - if (items[i]->HasVideoInfoTag() && - (( m_bMark && items[i]->GetVideoInfoTag()->m_playCount) || - (!m_bMark && !(items[i]->GetVideoInfoTag()->m_playCount)))) - continue; - -#ifdef HAS_UPNP - if (!URIUtils::IsUPnP(items[i]->GetPath()) || !UPNP::CUPnP::MarkWatched(*items[i], m_bMark)) -#endif - { - markItems.push_back(items[i]); - } - } - - if (!markItems.empty()) - { - CVideoDatabase database; - if (!database.Open()) - return false; - - database.BeginTransaction(); - - for (std::vector::const_iterator iter = markItems.begin(); iter != markItems.end(); ++iter) - { - CFileItemPtr pItem = *iter; - if (m_bMark) - { - std::string path(pItem->GetPath()); - if (pItem->HasVideoInfoTag()) - path = pItem->GetVideoInfoTag()->GetPath(); - - database.ClearBookMarksOfFile(path, CBookmark::RESUME); - database.IncrementPlayCount(*pItem); - } - else - database.SetPlayCount(*pItem, 0); - } - - database.CommitTransaction(); - database.Close(); - } - - return true; -} - -CMarkWatchedQueue &CMarkWatchedQueue::Get() -{ - static CMarkWatchedQueue markWatchedQueue; - return markWatchedQueue; -} - -void CMarkWatchedQueue::OnJobComplete(unsigned int jobID, bool success, CJob *job) -{ - if (success) - { - if (QueueEmpty()) - { - CUtil::DeleteVideoDatabaseDirectoryCache(); - CGUIMessage msg(GUI_MSG_NOTIFY_ALL, 0, 0, GUI_MSG_UPDATE); - g_windowManager.SendThreadMessage(msg); - } - return CJobQueue::OnJobComplete(jobID, success, job); - } - CancelJobs(); -} diff --git a/xbmc/video/VideoLibraryQueue.cpp b/xbmc/video/VideoLibraryQueue.cpp index 73353e9ce3546..843e420aeb926 100644 --- a/xbmc/video/VideoLibraryQueue.cpp +++ b/xbmc/video/VideoLibraryQueue.cpp @@ -25,6 +25,7 @@ #include "threads/SingleLock.h" #include "video/VideoDatabase.h" #include "video/jobs/VideoLibraryJob.h" +#include "video/jobs/VideoLibraryMarkWatchedJob.h" using namespace std; @@ -45,6 +46,14 @@ CVideoLibraryQueue& CVideoLibraryQueue::Get() return s_instance; } +void CVideoLibraryQueue::MarkAsWatched(const CFileItemPtr &item, bool watched) +{ + if (item == NULL) + return; + + AddJob(new CVideoLibraryMarkWatchedJob(item, watched)); +} + void CVideoLibraryQueue::AddJob(CVideoLibraryJob *job) { if (job == NULL) diff --git a/xbmc/video/VideoLibraryQueue.h b/xbmc/video/VideoLibraryQueue.h index 97334472c6a06..89433ff613305 100644 --- a/xbmc/video/VideoLibraryQueue.h +++ b/xbmc/video/VideoLibraryQueue.h @@ -22,6 +22,7 @@ #include #include +#include "FileItem.h" #include "threads/CriticalSection.h" #include "utils/JobManager.h" @@ -34,6 +35,8 @@ class CVideoLibraryQueue : protected CJobQueue static CVideoLibraryQueue& Get(); + void MarkAsWatched(const CFileItemPtr &item, bool watched); + void AddJob(CVideoLibraryJob *job); void CancelJob(CVideoLibraryJob *job); void CancelAllJobs(); diff --git a/xbmc/video/jobs/Makefile b/xbmc/video/jobs/Makefile index 6834b78d92466..8ab9cde39b577 100644 --- a/xbmc/video/jobs/Makefile +++ b/xbmc/video/jobs/Makefile @@ -1,4 +1,5 @@ -SRCS=VideoLibraryJob.cpp +SRCS=VideoLibraryJob.cpp \ + VideoLibraryMarkWatchedJob.cpp LIB=video-jobs.a diff --git a/xbmc/video/jobs/VideoLibraryMarkWatchedJob.cpp b/xbmc/video/jobs/VideoLibraryMarkWatchedJob.cpp new file mode 100644 index 0000000000000..452152f4c8899 --- /dev/null +++ b/xbmc/video/jobs/VideoLibraryMarkWatchedJob.cpp @@ -0,0 +1,105 @@ +/* + * Copyright (C) 2014 Team XBMC + * http://xbmc.org + * + * This Program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This Program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with XBMC; see the file COPYING. If not, see + * . + * + */ + +#include + +#include "VideoLibraryMarkWatchedJob.h" +#include "FileItem.h" +#include "Util.h" +#include "filesystem/Directory.h" +#ifdef HAS_UPNP +#include "network/upnp/UPnP.h" +#endif +#include "profiles/ProfilesManager.h" +#include "utils/URIUtils.h" +#include "video/VideoDatabase.h" + +CVideoLibraryMarkWatchedJob::CVideoLibraryMarkWatchedJob(const CFileItemPtr &item, bool mark) + : m_item(item), + m_mark(mark) +{ } + +CVideoLibraryMarkWatchedJob::~CVideoLibraryMarkWatchedJob() +{ } + +bool CVideoLibraryMarkWatchedJob::operator==(const CJob* job) const +{ + if (strcmp(job->GetType(), GetType()) != 0) + return false; + + const CVideoLibraryMarkWatchedJob* markJob = dynamic_cast(job); + if (markJob == NULL) + return false; + + return m_item->IsSamePath(markJob->m_item.get()) && markJob->m_mark == m_mark; +} + +bool CVideoLibraryMarkWatchedJob::Work(CVideoDatabase &db) +{ + if (!CProfilesManager::Get().GetCurrentProfile().canWriteDatabases()) + return false; + + CFileItemList items; + items.Add(CFileItemPtr(new CFileItem(*m_item))); + + if (m_item->m_bIsFolder) + CUtil::GetRecursiveListing(m_item->GetPath(), items, "", XFILE::DIR_FLAG_NO_FILE_INFO); + + std::vector markItems; + for (int i = 0; i < items.Size(); i++) + { + CFileItemPtr item = items.Get(i); + if (item->HasVideoInfoTag() && m_mark == (item->GetVideoInfoTag()->m_playCount > 0)) + continue; + +#ifdef HAS_UPNP + if (URIUtils::IsUPnP(item->GetPath()) && UPNP::CUPnP::MarkWatched(*item, m_mark)) + continue; +#endif + + markItems.push_back(item); + } + + if (markItems.empty()) + return true; + + db.BeginTransaction(); + + for (std::vector::const_iterator iter = markItems.begin(); iter != markItems.end(); ++iter) + { + CFileItemPtr item = *iter; + if (m_mark) + { + std::string path(item->GetPath()); + if (item->HasVideoInfoTag()) + path = item->GetVideoInfoTag()->GetPath(); + + db.ClearBookMarksOfFile(path, CBookmark::RESUME); + db.IncrementPlayCount(*item); + } + else + db.SetPlayCount(*item, 0); + } + + db.CommitTransaction(); + db.Close(); + + return true; +} diff --git a/xbmc/utils/MarkWatchedJob.h b/xbmc/video/jobs/VideoLibraryMarkWatchedJob.h similarity index 65% rename from xbmc/utils/MarkWatchedJob.h rename to xbmc/video/jobs/VideoLibraryMarkWatchedJob.h index cd59fd746e10c..59a4dcfd09cc8 100644 --- a/xbmc/utils/MarkWatchedJob.h +++ b/xbmc/video/jobs/VideoLibraryMarkWatchedJob.h @@ -19,26 +19,22 @@ * */ -#include "Job.h" -#include "utils/JobManager.h" +#include "FileItem.h" +#include "video/jobs/VideoLibraryJob.h" -class CMarkWatchedJob : public CJob +class CVideoLibraryMarkWatchedJob : public CVideoLibraryJob { public: - CMarkWatchedJob(const CFileItemPtr &item, bool bMark); -private: - virtual ~CMarkWatchedJob(); - virtual const char *GetType() const { return "markwatched"; } + CVideoLibraryMarkWatchedJob(const CFileItemPtr &item, bool mark); + virtual ~CVideoLibraryMarkWatchedJob(); + + virtual const char *GetType() const { return "CVideoLibraryMarkWatchedJob"; } virtual bool operator==(const CJob* job) const; - virtual bool DoWork(); - CFileItemPtr m_item; - bool m_bMark; -}; -class CMarkWatchedQueue: public CJobQueue -{ -public: - static CMarkWatchedQueue &Get(); +protected: + virtual bool Work(CVideoDatabase &db); + private: - virtual void OnJobComplete(unsigned int jobID, bool success, CJob *job); + CFileItemPtr m_item; + bool m_mark; }; diff --git a/xbmc/windows/GUIMediaWindow.cpp b/xbmc/windows/GUIMediaWindow.cpp index c8ccc85dfc3eb..a51a2216c2248 100644 --- a/xbmc/windows/GUIMediaWindow.cpp +++ b/xbmc/windows/GUIMediaWindow.cpp @@ -50,7 +50,7 @@ #include "dialogs/GUIDialogOK.h" #include "playlists/PlayList.h" #include "storage/MediaManager.h" -#include "utils/MarkWatchedJob.h" +#include "video/VideoLibraryQueue.h" #include "utils/StringUtils.h" #include "utils/URIUtils.h" #include "guilib/Key.h" @@ -1570,7 +1570,7 @@ bool CGUIMediaWindow::OnContextButton(int itemNumber, CONTEXT_BUTTON button) { CFileItemPtr item = m_vecItems->Get(itemNumber); m_viewControl.SetSelectedItem(m_viewControl.GetSelectedItem() + 1); - CMarkWatchedQueue::Get().AddJob(new CMarkWatchedJob(item, (button == CONTEXT_BUTTON_MARK_WATCHED))); + CVideoLibraryQueue::Get().MarkAsWatched(item, (button == CONTEXT_BUTTON_MARK_WATCHED)); return true; } case CONTEXT_BUTTON_ADD_FAVOURITE: From 7fd5f4ec740fcfc9aab5828fc732537b6fd2e93d Mon Sep 17 00:00:00 2001 From: montellese Date: Sat, 15 Nov 2014 10:26:20 +0100 Subject: [PATCH 07/13] video library: introduce CVideoLibraryCleaningJob --- xbmc/video/VideoInfoScanner.cpp | 13 +++-- xbmc/video/jobs/Makefile | 6 ++- xbmc/video/jobs/VideoLibraryCleaningJob.cpp | 59 +++++++++++++++++++++ xbmc/video/jobs/VideoLibraryCleaningJob.h | 46 ++++++++++++++++ xbmc/video/jobs/VideoLibraryProgressJob.cpp | 42 +++++++++++++++ xbmc/video/jobs/VideoLibraryProgressJob.h | 37 +++++++++++++ 6 files changed, 198 insertions(+), 5 deletions(-) create mode 100644 xbmc/video/jobs/VideoLibraryCleaningJob.cpp create mode 100644 xbmc/video/jobs/VideoLibraryCleaningJob.h create mode 100644 xbmc/video/jobs/VideoLibraryProgressJob.cpp create mode 100644 xbmc/video/jobs/VideoLibraryProgressJob.h diff --git a/xbmc/video/VideoInfoScanner.cpp b/xbmc/video/VideoInfoScanner.cpp index ce25e7b2d8163..dac03316b4aa7 100644 --- a/xbmc/video/VideoInfoScanner.cpp +++ b/xbmc/video/VideoInfoScanner.cpp @@ -47,6 +47,7 @@ #include "utils/URIUtils.h" #include "utils/Variant.h" #include "video/VideoThumbLoader.h" +#include "video/jobs/VideoLibraryCleaningJob.h" #include "TextureCache.h" #include "GUIUserMessages.h" #include "URL.h" @@ -248,9 +249,15 @@ namespace VIDEO void CVideoInfoScanner::CleanDatabase(CGUIDialogProgressBarHandle* handle /* = NULL */, const set& paths /* = set */, bool showProgress /* = true */) { m_bRunning = true; - m_database.Open(); - m_database.CleanDatabase(handle, paths, showProgress); - m_database.Close(); + CVideoLibraryCleaningJob* cleaningJob = NULL; + if (handle != NULL) + cleaningJob = new CVideoLibraryCleaningJob(paths, handle); + else + cleaningJob = new CVideoLibraryCleaningJob(paths, showProgress); + + cleaningJob->DoWork(); + + delete cleaningJob; m_bRunning = false; } diff --git a/xbmc/video/jobs/Makefile b/xbmc/video/jobs/Makefile index 8ab9cde39b577..f9897fa7c113f 100644 --- a/xbmc/video/jobs/Makefile +++ b/xbmc/video/jobs/Makefile @@ -1,5 +1,7 @@ -SRCS=VideoLibraryJob.cpp \ - VideoLibraryMarkWatchedJob.cpp +SRCS=VideoLibraryCleaningJob.cpp \ + VideoLibraryJob.cpp \ + VideoLibraryMarkWatchedJob.cpp \ + VideoLibraryProgressJob.cpp \ LIB=video-jobs.a diff --git a/xbmc/video/jobs/VideoLibraryCleaningJob.cpp b/xbmc/video/jobs/VideoLibraryCleaningJob.cpp new file mode 100644 index 0000000000000..035d91bcf2952 --- /dev/null +++ b/xbmc/video/jobs/VideoLibraryCleaningJob.cpp @@ -0,0 +1,59 @@ +/* + * Copyright (C) 2014 Team XBMC + * http://xbmc.org + * + * This Program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This Program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with XBMC; see the file COPYING. If not, see + * . + * + */ + +#include "VideoLibraryCleaningJob.h" +#include "dialogs/GUIDialogExtendedProgressBar.h" +#include "video/VideoDatabase.h" + +using namespace std; + +CVideoLibraryCleaningJob::CVideoLibraryCleaningJob(const std::set& paths /* = std::set() */, bool showDialog /* = false */) + : CVideoLibraryProgressJob(NULL), + m_paths(paths), + m_showDialog(showDialog) +{ } + +CVideoLibraryCleaningJob::CVideoLibraryCleaningJob(const std::set& paths, CGUIDialogProgressBarHandle* progressBar) + : CVideoLibraryProgressJob(progressBar), + m_paths(paths), + m_showDialog(false) +{ } + +CVideoLibraryCleaningJob::~CVideoLibraryCleaningJob() +{ } + +bool CVideoLibraryCleaningJob::operator==(const CJob* job) const +{ + if (strcmp(job->GetType(), GetType()) != 0) + return false; + + const CVideoLibraryCleaningJob* cleaningJob = dynamic_cast(job); + if (cleaningJob == NULL) + return false; + + return m_paths == cleaningJob->m_paths && + m_showDialog == cleaningJob->m_showDialog; +} + +bool CVideoLibraryCleaningJob::Work(CVideoDatabase &db) +{ + db.CleanDatabase(GetProgressBar(), m_paths, m_showDialog); + return true; +} diff --git a/xbmc/video/jobs/VideoLibraryCleaningJob.h b/xbmc/video/jobs/VideoLibraryCleaningJob.h new file mode 100644 index 0000000000000..73ea0a89c56be --- /dev/null +++ b/xbmc/video/jobs/VideoLibraryCleaningJob.h @@ -0,0 +1,46 @@ +#pragma once +/* + * Copyright (C) 2014 Team XBMC + * http://xbmc.org + * + * This Program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This Program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with XBMC; see the file COPYING. If not, see + * . + * + */ + +#include + +#include "video/jobs/VideoLibraryProgressJob.h" + +class CGUIDialogProgressBarHandle; + +class CVideoLibraryCleaningJob : public CVideoLibraryProgressJob +{ +public: + CVideoLibraryCleaningJob(const std::set& paths = std::set(), bool showDialog = false); + CVideoLibraryCleaningJob(const std::set& paths, CGUIDialogProgressBarHandle* progressBar); + virtual ~CVideoLibraryCleaningJob(); + + // specialization of CJob + virtual const char *GetType() const { return "VideoLibraryCleaningJob"; } + virtual bool operator==(const CJob* job) const; + +protected: + // implementation of CVideoLibraryJob + virtual bool Work(CVideoDatabase &db); + +private: + std::set m_paths; + bool m_showDialog; +}; diff --git a/xbmc/video/jobs/VideoLibraryProgressJob.cpp b/xbmc/video/jobs/VideoLibraryProgressJob.cpp new file mode 100644 index 0000000000000..ff9e34dab0d1d --- /dev/null +++ b/xbmc/video/jobs/VideoLibraryProgressJob.cpp @@ -0,0 +1,42 @@ +/* + * Copyright (C) 2014 Team XBMC + * http://xbmc.org + * + * This Program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This Program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with XBMC; see the file COPYING. If not, see + * . + * + */ + +#include "VideoLibraryProgressJob.h" + +using namespace std; + +CVideoLibraryProgressJob::CVideoLibraryProgressJob(CGUIDialogProgressBarHandle* progressBar) + : CProgressJob(progressBar) +{ } + +CVideoLibraryProgressJob::~CVideoLibraryProgressJob() +{ } + +bool CVideoLibraryProgressJob::DoWork() +{ + SetProgress(0.0f); + + bool result = CVideoLibraryJob::DoWork(); + + SetProgress(100.0f); + MarkFinished(); + + return result; +} diff --git a/xbmc/video/jobs/VideoLibraryProgressJob.h b/xbmc/video/jobs/VideoLibraryProgressJob.h new file mode 100644 index 0000000000000..b9e69ab64be21 --- /dev/null +++ b/xbmc/video/jobs/VideoLibraryProgressJob.h @@ -0,0 +1,37 @@ +#pragma once +/* + * Copyright (C) 2014 Team XBMC + * http://xbmc.org + * + * This Program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This Program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with XBMC; see the file COPYING. If not, see + * . + * + */ + +#include "utils/ProgressJob.h" +#include "video/jobs/VideoLibraryJob.h" + +class CVideoLibraryProgressJob : public CProgressJob, public CVideoLibraryJob +{ +public: + virtual ~CVideoLibraryProgressJob(); + + // implementation of CJob + virtual bool DoWork(); + virtual const char *GetType() const { return "CVideoLibraryProgressJob"; } + virtual bool operator==(const CJob* job) const { return false; } + +protected: + CVideoLibraryProgressJob(CGUIDialogProgressBarHandle* progressBar); +}; From d046ae9e0fb6ca5cd618cced4b6afefd8dd23b7a Mon Sep 17 00:00:00 2001 From: montellese Date: Sat, 31 Jan 2015 17:37:07 +0100 Subject: [PATCH 08/13] video library: move all video library cleaning logic into CVideoLibraryQueue --- xbmc/Application.cpp | 15 +++++--------- xbmc/video/VideoInfoScanner.cpp | 35 +++----------------------------- xbmc/video/VideoInfoScanner.h | 2 -- xbmc/video/VideoLibraryQueue.cpp | 34 +++++++++++++++++++++++++++++-- xbmc/video/VideoLibraryQueue.h | 7 +++++++ 5 files changed, 47 insertions(+), 46 deletions(-) diff --git a/xbmc/Application.cpp b/xbmc/Application.cpp index d8f5fa382fbd5..02a2ce951bddb 100644 --- a/xbmc/Application.cpp +++ b/xbmc/Application.cpp @@ -4952,7 +4952,7 @@ void CApplication::UpdateLibraries() bool CApplication::IsVideoScanning() const { - return m_videoInfoScanner->IsScanning(); + return m_videoInfoScanner->IsScanning() || CVideoLibraryQueue::Get().IsRunning(); } bool CApplication::IsMusicScanning() const @@ -4974,19 +4974,14 @@ void CApplication::StopMusicScan() void CApplication::StartVideoCleanup(bool userInitiated /* = true */) { - if (m_videoInfoScanner->IsScanning()) + if (userInitiated && IsVideoScanning()) return; + std::set paths; if (userInitiated) - { - std::set paths; - m_videoInfoScanner->CleanDatabase(NULL, paths, userInitiated); - } + CVideoLibraryQueue::Get().CleanLibraryModal(paths); else - { - m_videoInfoScanner->ShowDialog(false); - m_videoInfoScanner->StartCleanDatabase(); - } + CVideoLibraryQueue::Get().CleanLibrary(paths, false); } void CApplication::StartVideoScan(const std::string &strDirectory, bool userInitiated /* = true */, bool scanAll /* = false */) diff --git a/xbmc/video/VideoInfoScanner.cpp b/xbmc/video/VideoInfoScanner.cpp index dac03316b4aa7..7946a85d0a1f5 100644 --- a/xbmc/video/VideoInfoScanner.cpp +++ b/xbmc/video/VideoInfoScanner.cpp @@ -46,8 +46,8 @@ #include "utils/log.h" #include "utils/URIUtils.h" #include "utils/Variant.h" +#include "video/VideoLibraryQueue.h" #include "video/VideoThumbLoader.h" -#include "video/jobs/VideoLibraryCleaningJob.h" #include "TextureCache.h" #include "GUIUserMessages.h" #include "URL.h" @@ -91,7 +91,7 @@ namespace VIDEO if (m_bClean && m_pathsToScan.empty()) { std::set paths; - CleanDatabase(m_handle, paths, false); + CVideoLibraryQueue::Get().CleanLibrary(paths, false, m_handle); if (m_handle) m_handle->MarkFinished(); @@ -149,7 +149,7 @@ namespace VIDEO if (!bCancelled) { if (m_bClean) - CleanDatabase(m_handle, m_pathsToClean, false); + CVideoLibraryQueue::Get().CleanLibrary(m_pathsToClean, false, m_handle); else { if (m_handle) @@ -219,20 +219,6 @@ namespace VIDEO m_bRunning = true; } - void CVideoInfoScanner::StartCleanDatabase() - { - m_strStartDir.clear(); - m_scanAll = false; - m_pathsToScan.clear(); - m_pathsToClean.clear(); - - m_bClean = true; - - StopThread(); - Create(); - m_bRunning = true; - } - bool CVideoInfoScanner::IsScanning() { return m_bRunning; @@ -246,21 +232,6 @@ namespace VIDEO StopThread(false); } - void CVideoInfoScanner::CleanDatabase(CGUIDialogProgressBarHandle* handle /* = NULL */, const set& paths /* = set */, bool showProgress /* = true */) - { - m_bRunning = true; - CVideoLibraryCleaningJob* cleaningJob = NULL; - if (handle != NULL) - cleaningJob = new CVideoLibraryCleaningJob(paths, handle); - else - cleaningJob = new CVideoLibraryCleaningJob(paths, showProgress); - - cleaningJob->DoWork(); - - delete cleaningJob; - m_bRunning = false; - } - static void OnDirectoryScanned(const std::string& strDirectory) { CGUIMessage msg(GUI_MSG_DIRECTORY_SCANNED, 0, 0, 0); diff --git a/xbmc/video/VideoInfoScanner.h b/xbmc/video/VideoInfoScanner.h index 7d97cbc1c9d1a..7b214f7476922 100644 --- a/xbmc/video/VideoInfoScanner.h +++ b/xbmc/video/VideoInfoScanner.h @@ -59,9 +59,7 @@ namespace VIDEO \param scanAll whether to scan everything not already scanned (regardless of whether the user normally doesn't want a folder scanned.) Defaults to false. */ void Start(const std::string& strDirectory, bool scanAll = false); - void StartCleanDatabase(); bool IsScanning(); - void CleanDatabase(CGUIDialogProgressBarHandle* handle = NULL, const std::set& paths = std::set(), bool showProgress = true); void Stop(); //! \brief Set whether or not to show a progress dialog diff --git a/xbmc/video/VideoLibraryQueue.cpp b/xbmc/video/VideoLibraryQueue.cpp index 843e420aeb926..b313868525365 100644 --- a/xbmc/video/VideoLibraryQueue.cpp +++ b/xbmc/video/VideoLibraryQueue.cpp @@ -24,6 +24,7 @@ #include "guilib/GUIWindowManager.h" #include "threads/SingleLock.h" #include "video/VideoDatabase.h" +#include "video/jobs/VideoLibraryCleaningJob.h" #include "video/jobs/VideoLibraryJob.h" #include "video/jobs/VideoLibraryMarkWatchedJob.h" @@ -31,7 +32,8 @@ using namespace std; CVideoLibraryQueue::CVideoLibraryQueue() : CJobQueue(false, 1, CJob::PRIORITY_LOW_PAUSABLE), - m_jobs() + m_jobs(), + m_cleaning(false) { } CVideoLibraryQueue::~CVideoLibraryQueue() @@ -46,6 +48,34 @@ CVideoLibraryQueue& CVideoLibraryQueue::Get() return s_instance; } +void CVideoLibraryQueue::CleanLibrary(const std::set& paths /* = std::set() */, bool asynchronous /* = true */, CGUIDialogProgressBarHandle* progressBar /* = NULL */) +{ + CVideoLibraryCleaningJob* cleaningJob = new CVideoLibraryCleaningJob(paths, progressBar); + + if (asynchronous) + AddJob(cleaningJob); + else + { + m_cleaning = true; + cleaningJob->DoWork(); + + delete cleaningJob; + m_cleaning = false; + } +} + +void CVideoLibraryQueue::CleanLibraryModal(const std::set& paths /* = std::set() */) +{ + // we can't perform a modal library cleaning if other jobs are running + if (IsRunning()) + return; + + m_cleaning = true; + CVideoLibraryCleaningJob cleaningJob(paths, true); + cleaningJob.DoWork(); + m_cleaning = false; +} + void CVideoLibraryQueue::MarkAsWatched(const CFileItemPtr &item, bool watched) { if (item == NULL) @@ -104,7 +134,7 @@ void CVideoLibraryQueue::CancelAllJobs() bool CVideoLibraryQueue::IsRunning() const { - return CJobQueue::IsProcessing(); + return CJobQueue::IsProcessing() || m_cleaning; } void CVideoLibraryQueue::OnJobComplete(unsigned int jobID, bool success, CJob *job) diff --git a/xbmc/video/VideoLibraryQueue.h b/xbmc/video/VideoLibraryQueue.h index 89433ff613305..d224620a6b2ab 100644 --- a/xbmc/video/VideoLibraryQueue.h +++ b/xbmc/video/VideoLibraryQueue.h @@ -26,6 +26,7 @@ #include "threads/CriticalSection.h" #include "utils/JobManager.h" +class CGUIDialogProgressBarHandle; class CVideoLibraryJob; class CVideoLibraryQueue : protected CJobQueue @@ -35,6 +36,10 @@ class CVideoLibraryQueue : protected CJobQueue static CVideoLibraryQueue& Get(); + void CleanLibrary(const std::set& paths = std::set(), bool asynchronous = true, CGUIDialogProgressBarHandle* progressBar = NULL); + + void CleanLibraryModal(const std::set& paths = std::set()); + void MarkAsWatched(const CFileItemPtr &item, bool watched); void AddJob(CVideoLibraryJob *job); @@ -56,4 +61,6 @@ class CVideoLibraryQueue : protected CJobQueue typedef std::map VideoLibraryJobMap; VideoLibraryJobMap m_jobs; CCriticalSection m_critical; + + bool m_cleaning; }; From d68f1379b0a1530a14ce45a09e64dd82e12eac33 Mon Sep 17 00:00:00 2001 From: montellese Date: Sun, 1 Feb 2015 12:47:27 +0100 Subject: [PATCH 09/13] video library: add CVideoLibraryScanningJob --- xbmc/video/jobs/Makefile | 1 + xbmc/video/jobs/VideoLibraryScanningJob.cpp | 64 +++++++++++++++++++++ xbmc/video/jobs/VideoLibraryScanningJob.h | 50 ++++++++++++++++ 3 files changed, 115 insertions(+) create mode 100644 xbmc/video/jobs/VideoLibraryScanningJob.cpp create mode 100644 xbmc/video/jobs/VideoLibraryScanningJob.h diff --git a/xbmc/video/jobs/Makefile b/xbmc/video/jobs/Makefile index f9897fa7c113f..7fd9e0ba27ac0 100644 --- a/xbmc/video/jobs/Makefile +++ b/xbmc/video/jobs/Makefile @@ -2,6 +2,7 @@ SRCS=VideoLibraryCleaningJob.cpp \ VideoLibraryJob.cpp \ VideoLibraryMarkWatchedJob.cpp \ VideoLibraryProgressJob.cpp \ + VideoLibraryScanningJob.cpp \ LIB=video-jobs.a diff --git a/xbmc/video/jobs/VideoLibraryScanningJob.cpp b/xbmc/video/jobs/VideoLibraryScanningJob.cpp new file mode 100644 index 0000000000000..957d9d6f08d35 --- /dev/null +++ b/xbmc/video/jobs/VideoLibraryScanningJob.cpp @@ -0,0 +1,64 @@ +/* + * Copyright (C) 2014 Team XBMC + * http://xbmc.org + * + * This Program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This Program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with XBMC; see the file COPYING. If not, see + * . + * + */ + +#include "VideoLibraryScanningJob.h" +#include "video/VideoDatabase.h" + +using namespace std; + +CVideoLibraryScanningJob::CVideoLibraryScanningJob(const std::string& directory, bool scanAll /* = false */, bool showProgress /* = true */) + : m_scanner(), + m_directory(directory), + m_showProgress(showProgress), + m_scanAll(scanAll) +{ } + +CVideoLibraryScanningJob::~CVideoLibraryScanningJob() +{ } + +bool CVideoLibraryScanningJob::Cancel() +{ + if (!m_scanner.IsScanning()) + return true; + + m_scanner.Stop(); + return true; +} + +bool CVideoLibraryScanningJob::operator==(const CJob* job) const +{ + if (strcmp(job->GetType(), GetType()) != 0) + return false; + + const CVideoLibraryScanningJob* scanningJob = dynamic_cast(job); + if (scanningJob == NULL) + return false; + + return m_directory == scanningJob->m_directory && + m_scanAll == scanningJob->m_scanAll; +} + +bool CVideoLibraryScanningJob::Work(CVideoDatabase &db) +{ + m_scanner.ShowDialog(m_showProgress); + m_scanner.Start(m_directory, m_scanAll); + + return true; +} diff --git a/xbmc/video/jobs/VideoLibraryScanningJob.h b/xbmc/video/jobs/VideoLibraryScanningJob.h new file mode 100644 index 0000000000000..ec7065649c124 --- /dev/null +++ b/xbmc/video/jobs/VideoLibraryScanningJob.h @@ -0,0 +1,50 @@ +#pragma once +/* + * Copyright (C) 2014 Team XBMC + * http://xbmc.org + * + * This Program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This Program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with XBMC; see the file COPYING. If not, see + * . + * + */ + +#include + +#include "video/VideoInfoScanner.h" +#include "video/jobs/VideoLibraryJob.h" + +class CVideoLibraryScanningJob : public CVideoLibraryJob +{ +public: + CVideoLibraryScanningJob(const std::string& directory, bool scanAll = false, bool showProgress = true); + virtual ~CVideoLibraryScanningJob(); + + // specialization of CVideoLibraryJob + virtual bool CanBeCancelled() const { return true; } + virtual bool Cancel(); + + // specialization of CJob + virtual const char *GetType() const { return "VideoLibraryScanningJob"; } + virtual bool operator==(const CJob* job) const; + +protected: + // implementation of CVideoLibraryJob + virtual bool Work(CVideoDatabase &db); + +private: + VIDEO::CVideoInfoScanner m_scanner; + std::string m_directory; + bool m_showProgress; + bool m_scanAll; +}; From f05185282e73e69a823dca75be47f1568b77a0e3 Mon Sep 17 00:00:00 2001 From: montellese Date: Sun, 1 Feb 2015 12:50:58 +0100 Subject: [PATCH 10/13] video library: move all video library scanning logic into CVideoLibraryQueue and allow queueing multiple library scans --- xbmc/Application.cpp | 23 +++++--------- xbmc/Application.h | 1 - xbmc/interfaces/Builtins.cpp | 5 +-- xbmc/video/VideoInfoScanner.cpp | 24 +++++--------- xbmc/video/VideoInfoScanner.h | 6 ++-- xbmc/video/VideoLibraryQueue.cpp | 40 ++++++++++++++++++++++++ xbmc/video/VideoLibraryQueue.h | 3 ++ xbmc/video/windows/GUIWindowVideoNav.cpp | 13 ++++---- 8 files changed, 70 insertions(+), 45 deletions(-) diff --git a/xbmc/Application.cpp b/xbmc/Application.cpp index 02a2ce951bddb..8686a67cfc085 100644 --- a/xbmc/Application.cpp +++ b/xbmc/Application.cpp @@ -37,6 +37,7 @@ #include "PlayListPlayer.h" #include "Autorun.h" #include "video/Bookmark.h" +#include "video/VideoLibraryQueue.h" #include "network/NetworkServices.h" #include "guilib/GUIControlProfiler.h" #include "utils/LangCodeExpander.h" @@ -294,7 +295,6 @@ CApplication::CApplication(void) , m_stackFileItemToUpdate(new CFileItem) , m_progressTrackingVideoResumeBookmark(*new CBookmark) , m_progressTrackingItem(new CFileItem) - , m_videoInfoScanner(new CVideoInfoScanner) , m_musicInfoScanner(new CMusicInfoScanner) , m_playerController(new CPlayerController) { @@ -352,7 +352,6 @@ CApplication::CApplication(void) CApplication::~CApplication(void) { delete m_musicInfoScanner; - delete m_videoInfoScanner; delete &m_progressTrackingVideoResumeBookmark; #ifdef HAS_DVD_DRIVE delete m_Autorun; @@ -2814,8 +2813,8 @@ void CApplication::Stop(int exitCode) if (m_musicInfoScanner->IsScanning()) m_musicInfoScanner->Stop(); - if (m_videoInfoScanner->IsScanning()) - m_videoInfoScanner->Stop(); + if (CVideoLibraryQueue::Get().IsRunning()) + CVideoLibraryQueue::Get().CancelAllJobs(); CApplicationMessenger::Get().Cleanup(); @@ -4039,7 +4038,7 @@ void CApplication::CheckShutdown() if (m_bInhibitIdleShutdown || m_pPlayer->IsPlaying() || m_pPlayer->IsPausedPlayback() // is something playing? || m_musicInfoScanner->IsScanning() - || m_videoInfoScanner->IsScanning() + || CVideoLibraryQueue::Get().IsRunning() || g_windowManager.IsWindowActive(WINDOW_DIALOG_PROGRESS) // progress dialog is onscreen || !g_PVRManager.CanSystemPowerdown(false)) { @@ -4952,7 +4951,7 @@ void CApplication::UpdateLibraries() bool CApplication::IsVideoScanning() const { - return m_videoInfoScanner->IsScanning() || CVideoLibraryQueue::Get().IsRunning(); + return CVideoLibraryQueue::Get().IsScanningLibrary(); } bool CApplication::IsMusicScanning() const @@ -4962,8 +4961,7 @@ bool CApplication::IsMusicScanning() const void CApplication::StopVideoScan() { - if (m_videoInfoScanner->IsScanning()) - m_videoInfoScanner->Stop(); + CVideoLibraryQueue::Get().StopLibraryScanning(); } void CApplication::StopMusicScan() @@ -4974,7 +4972,7 @@ void CApplication::StopMusicScan() void CApplication::StartVideoCleanup(bool userInitiated /* = true */) { - if (userInitiated && IsVideoScanning()) + if (userInitiated && CVideoLibraryQueue::Get().IsRunning()) return; std::set paths; @@ -4986,12 +4984,7 @@ void CApplication::StartVideoCleanup(bool userInitiated /* = true */) void CApplication::StartVideoScan(const std::string &strDirectory, bool userInitiated /* = true */, bool scanAll /* = false */) { - if (m_videoInfoScanner->IsScanning()) - return; - - m_videoInfoScanner->ShowDialog(userInitiated); - - m_videoInfoScanner->Start(strDirectory,scanAll); + CVideoLibraryQueue::Get().ScanLibrary(strDirectory, scanAll, userInitiated); } void CApplication::StartMusicCleanup(bool userInitiated /* = true */) diff --git a/xbmc/Application.h b/xbmc/Application.h index 543a890c3df50..bc4b5a874794e 100644 --- a/xbmc/Application.h +++ b/xbmc/Application.h @@ -471,7 +471,6 @@ class CApplication : public CXBApplicationEx, public IPlayerCallback, public IMs bool m_bTestMode; bool m_bSystemScreenSaverEnable; - VIDEO::CVideoInfoScanner *m_videoInfoScanner; MUSIC_INFO::CMusicInfoScanner *m_musicInfoScanner; bool m_muted; diff --git a/xbmc/interfaces/Builtins.cpp b/xbmc/interfaces/Builtins.cpp index 399460875ab13..501e80b428169 100644 --- a/xbmc/interfaces/Builtins.cpp +++ b/xbmc/interfaces/Builtins.cpp @@ -61,6 +61,7 @@ #include "settings/SkinSettings.h" #include "utils/StringUtils.h" #include "utils/URIUtils.h" +#include "video/VideoLibraryQueue.h" #include "Util.h" #include "URL.h" #include "music/MusicDatabase.h" @@ -1458,8 +1459,8 @@ int CBuiltins::Execute(const std::string& execString) if (g_application.IsMusicScanning()) g_application.StopMusicScan(); - if (g_application.IsVideoScanning()) - g_application.StopVideoScan(); + if (CVideoLibraryQueue::Get().IsRunning()) + CVideoLibraryQueue::Get().CancelAllJobs(); ADDON::CAddonMgr::Get().StopServices(true); diff --git a/xbmc/video/VideoInfoScanner.cpp b/xbmc/video/VideoInfoScanner.cpp index 7946a85d0a1f5..07ae0630f5477 100644 --- a/xbmc/video/VideoInfoScanner.cpp +++ b/xbmc/video/VideoInfoScanner.cpp @@ -59,8 +59,9 @@ using namespace ADDON; namespace VIDEO { - CVideoInfoScanner::CVideoInfoScanner() : CThread("VideoInfoScanner") + CVideoInfoScanner::CVideoInfoScanner() { + m_bStop = false; m_bRunning = false; m_handle = NULL; m_showDialog = false; @@ -77,6 +78,8 @@ namespace VIDEO void CVideoInfoScanner::Process() { + m_bStop = false; + try { if (m_showDialog && !CSettings::Get().GetBool("videolibrary.backgroundupdate")) @@ -115,8 +118,6 @@ namespace VIDEO m_currentItem = 0; m_itemCount = -1; - SetPriority(GetMinPriority()); - // Database operations should not be canceled // using Interupt() while scanning as it could // result in unexpected behaviour. @@ -170,11 +171,6 @@ namespace VIDEO m_bRunning = false; ANNOUNCEMENT::CAnnouncementManager::Get().Announce(ANNOUNCEMENT::VideoLibrary, "xbmc", "OnScanFinished"); - - // we need to clear the videodb cache and update any active lists - CUtil::DeleteVideoDatabaseDirectoryCache(); - CGUIMessage msg(GUI_MSG_SCAN_FINISHED, 0, 0, 0); - g_windowManager.SendThreadMessage(msg); if (m_handle) m_handle->MarkFinished(); @@ -214,14 +210,8 @@ namespace VIDEO m_database.Close(); m_bClean = g_advancedSettings.m_bVideoLibraryCleanOnUpdate; - StopThread(); - Create(); m_bRunning = true; - } - - bool CVideoInfoScanner::IsScanning() - { - return m_bRunning; + Process(); } void CVideoInfoScanner::Stop() @@ -229,7 +219,7 @@ namespace VIDEO if (m_bCanInterrupt) m_database.Interupt(); - StopThread(false); + m_bStop = true; } static void OnDirectoryScanned(const std::string& strDirectory) @@ -1232,7 +1222,7 @@ namespace VIDEO CFileItemPtr itemCopy = CFileItemPtr(new CFileItem(*pItem)); CVariant data; - if (IsScanning()) + if (m_bRunning) data["transaction"] = true; ANNOUNCEMENT::CAnnouncementManager::Get().Announce(ANNOUNCEMENT::VideoLibrary, "xbmc", "OnUpdate", itemCopy, data); return lResult; diff --git a/xbmc/video/VideoInfoScanner.h b/xbmc/video/VideoInfoScanner.h index 7b214f7476922..b30d8ec017238 100644 --- a/xbmc/video/VideoInfoScanner.h +++ b/xbmc/video/VideoInfoScanner.h @@ -18,7 +18,6 @@ * . * */ -#include "threads/Thread.h" #include "VideoDatabase.h" #include "addons/Scraper.h" #include "NfoFile.h" @@ -48,7 +47,7 @@ namespace VIDEO INFO_NOT_FOUND, INFO_ADDED }; - class CVideoInfoScanner : CThread + class CVideoInfoScanner { public: CVideoInfoScanner(); @@ -59,7 +58,7 @@ namespace VIDEO \param scanAll whether to scan everything not already scanned (regardless of whether the user normally doesn't want a folder scanned.) Defaults to false. */ void Start(const std::string& strDirectory, bool scanAll = false); - bool IsScanning(); + bool IsScanning() const { return m_bRunning; } void Stop(); //! \brief Set whether or not to show a progress dialog @@ -245,6 +244,7 @@ namespace VIDEO CGUIDialogProgressBarHandle* m_handle; int m_currentItem; int m_itemCount; + bool m_bStop; bool m_bRunning; bool m_bCanInterrupt; bool m_bClean; diff --git a/xbmc/video/VideoLibraryQueue.cpp b/xbmc/video/VideoLibraryQueue.cpp index b313868525365..cc5530a2396c4 100644 --- a/xbmc/video/VideoLibraryQueue.cpp +++ b/xbmc/video/VideoLibraryQueue.cpp @@ -27,6 +27,7 @@ #include "video/jobs/VideoLibraryCleaningJob.h" #include "video/jobs/VideoLibraryJob.h" #include "video/jobs/VideoLibraryMarkWatchedJob.h" +#include "video/jobs/VideoLibraryScanningJob.h" using namespace std; @@ -48,6 +49,45 @@ CVideoLibraryQueue& CVideoLibraryQueue::Get() return s_instance; } +void CVideoLibraryQueue::ScanLibrary(const std::string& directory, bool scanAll /* = false */ , bool showProgress /* = true */) +{ + AddJob(new CVideoLibraryScanningJob(directory, scanAll, showProgress)); +} + +bool CVideoLibraryQueue::IsScanningLibrary() const +{ + // check if the library is being cleaned synchronously + if (m_cleaning) + return true; + + // check if the library is being scanned asynchronously + VideoLibraryJobMap::const_iterator scanningJobs = m_jobs.find("VideoLibraryScanningJob"); + if (scanningJobs != m_jobs.end() && !scanningJobs->second.empty()) + return true; + + // check if the library is being cleaned asynchronously + VideoLibraryJobMap::const_iterator cleaningJobs = m_jobs.find("VideoLibraryCleaningJob"); + if (cleaningJobs != m_jobs.end() && !cleaningJobs->second.empty()) + return true; + + return false; +} + +void CVideoLibraryQueue::StopLibraryScanning() +{ + CSingleLock lock(m_critical); + VideoLibraryJobMap::const_iterator scanningJobs = m_jobs.find("VideoLibraryScanningJob"); + if (scanningJobs == m_jobs.end()) + return; + + // get a copy of the scanning jobs because CancelJob() will modify m_scanningJobs + VideoLibraryJobs tmpScanningJobs(scanningJobs->second.begin(), scanningJobs->second.end()); + + // cancel all scanning jobs + for (VideoLibraryJobs::const_iterator job = tmpScanningJobs.begin(); job != tmpScanningJobs.end(); ++job) + CancelJob(*job); +} + void CVideoLibraryQueue::CleanLibrary(const std::set& paths /* = std::set() */, bool asynchronous /* = true */, CGUIDialogProgressBarHandle* progressBar /* = NULL */) { CVideoLibraryCleaningJob* cleaningJob = new CVideoLibraryCleaningJob(paths, progressBar); diff --git a/xbmc/video/VideoLibraryQueue.h b/xbmc/video/VideoLibraryQueue.h index d224620a6b2ab..eebdb9a5cbda5 100644 --- a/xbmc/video/VideoLibraryQueue.h +++ b/xbmc/video/VideoLibraryQueue.h @@ -36,6 +36,9 @@ class CVideoLibraryQueue : protected CJobQueue static CVideoLibraryQueue& Get(); + void ScanLibrary(const std::string& directory, bool scanAll = false, bool showProgress = true); + bool IsScanningLibrary() const; + void StopLibraryScanning(); void CleanLibrary(const std::set& paths = std::set(), bool asynchronous = true, CGUIDialogProgressBarHandle* progressBar = NULL); void CleanLibraryModal(const std::set& paths = std::set()); diff --git a/xbmc/video/windows/GUIWindowVideoNav.cpp b/xbmc/video/windows/GUIWindowVideoNav.cpp index f70851f6f8cd3..8d4128703f202 100644 --- a/xbmc/video/windows/GUIWindowVideoNav.cpp +++ b/xbmc/video/windows/GUIWindowVideoNav.cpp @@ -192,7 +192,6 @@ bool CGUIWindowVideoNav::OnMessage(CGUIMessage& message) } break; // update the display - case GUI_MSG_SCAN_FINISHED: case GUI_MSG_REFRESH_THUMBS: Refresh(); break; @@ -814,7 +813,7 @@ void CGUIWindowVideoNav::GetContextButtons(int itemNumber, CContextButtons &butt } } - if (info && !g_application.IsVideoScanning()) + if (info) buttons.Add(CONTEXT_BUTTON_SCAN, 13349); } } @@ -902,8 +901,8 @@ void CGUIWindowVideoNav::GetContextButtons(int itemNumber, CContextButtons &butt { if (g_application.IsVideoScanning()) buttons.Add(CONTEXT_BUTTON_STOP_SCANNING, 13353); - else - buttons.Add(CONTEXT_BUTTON_SCAN, 13349); + + buttons.Add(CONTEXT_BUTTON_SCAN, 13349); } if (node == NODE_TYPE_SEASONS && item->m_bIsFolder) @@ -934,13 +933,13 @@ void CGUIWindowVideoNav::GetContextButtons(int itemNumber, CContextButtons &butt if (!g_application.IsVideoScanning()) { if (info && info->Content() != CONTENT_NONE) - { buttons.Add(CONTEXT_BUTTON_SET_CONTENT, 20442); - buttons.Add(CONTEXT_BUTTON_SCAN, 13349); - } else buttons.Add(CONTEXT_BUTTON_SET_CONTENT, 20333); } + + if (info && info->Content() != CONTENT_NONE) + buttons.Add(CONTEXT_BUTTON_SCAN, 13349); } } if (item->IsPlugin() || item->IsScript() || m_vecItems->IsPlugin()) From 646be0aadd540fe2c5f637b7ece10c6a43c70ed4 Mon Sep 17 00:00:00 2001 From: montellese Date: Thu, 12 Feb 2015 20:26:16 +0100 Subject: [PATCH 11/13] video library: add documentation for CVideoLibraryQueue and CVideoLibraryJob implementations --- xbmc/utils/ProgressJob.h | 34 +++++++++++ xbmc/video/VideoLibraryQueue.h | 63 ++++++++++++++++++++ xbmc/video/jobs/VideoLibraryCleaningJob.h | 16 +++++ xbmc/video/jobs/VideoLibraryJob.h | 19 ++++++ xbmc/video/jobs/VideoLibraryMarkWatchedJob.h | 9 +++ xbmc/video/jobs/VideoLibraryProgressJob.h | 3 + xbmc/video/jobs/VideoLibraryScanningJob.h | 13 ++++ 7 files changed, 157 insertions(+) diff --git a/xbmc/utils/ProgressJob.h b/xbmc/utils/ProgressJob.h index 35a7b28d5da1e..db1b356132955 100644 --- a/xbmc/utils/ProgressJob.h +++ b/xbmc/utils/ProgressJob.h @@ -25,6 +25,10 @@ class CGUIDialogProgressBarHandle; +/*! + \brief Basic implementation of a CJob with a progress bar to indicate the + progress of the job being processed. + */ class CProgressJob : public CJob { public: @@ -37,13 +41,43 @@ class CProgressJob : public CJob protected: CProgressJob(CGUIDialogProgressBarHandle* progressBar); + /*! + \brief Returns the progress bar indicating the progress of the job. + */ CGUIDialogProgressBarHandle* GetProgressBar() { return m_progress; } + /*! + \brief Sets the given title as the title of the progress bar. + + \param[in] title Title to be set + */ void SetTitle(const std::string &title); + + /*! + \brief Sets the given text as the description of the progress bar. + + \param[in] text Text to be set + */ void SetText(const std::string &text); + /*! + \brief Sets the progress of the progress bar to the given value in percentage. + + \param[in] percentage Percentage to be set as the current progress + */ void SetProgress(float percentage); + + /*! + \brief Sets the progress of the progress bar to the given value. + + \param[in] currentStep Current step being processed + \param[in] totalSteps Total steps to be processed + */ void SetProgress(int currentStep, int totalSteps); + + /*! + \brief Marks the progress as finished by setting it to 100%. + */ void MarkFinished(); private: diff --git a/xbmc/video/VideoLibraryQueue.h b/xbmc/video/VideoLibraryQueue.h index eebdb9a5cbda5..8ebf0aadcbe28 100644 --- a/xbmc/video/VideoLibraryQueue.h +++ b/xbmc/video/VideoLibraryQueue.h @@ -29,26 +29,89 @@ class CGUIDialogProgressBarHandle; class CVideoLibraryJob; +/*! + \brief Queue for video library jobs. + + The queue can only process a single job at any time and every job will be + executed at the lowest priority. + */ class CVideoLibraryQueue : protected CJobQueue { public: ~CVideoLibraryQueue(); + /*! + \brief Gets the singleton instance of the video library queue. + */ static CVideoLibraryQueue& Get(); + /*! + \brief Enqueue a library scan job. + + \param[in] directory Directory to scan + \param[in] scanAll Ignore exclude setting for items. Defaults to false + \param[in] showProgress Whether or not to show a progress dialog. Defaults to true + */ void ScanLibrary(const std::string& directory, bool scanAll = false, bool showProgress = true); + + /*! + \brief Check if a library scan is in progress. + + \return True if a scan is in progress, false otherwise + */ bool IsScanningLibrary() const; + + /*! + \brief Stop and dequeue all scanning jobs. + */ void StopLibraryScanning(); + + /*! + \brief Enqueue a library cleaning job. + + \param[in] paths Set with database IDs of paths to be cleaned + \param[in] asynchronous Run the clean job asynchronously. Defaults to true + \param[in] progressBar Progress bar to update in GUI. Defaults to NULL (no progress bar to update) + */ void CleanLibrary(const std::set& paths = std::set(), bool asynchronous = true, CGUIDialogProgressBarHandle* progressBar = NULL); + /*! + \brief Executes a library cleaning with a modal dialog. + + \param[in] paths Set with database IDs of paths to be cleaned + */ void CleanLibraryModal(const std::set& paths = std::set()); + /*! + \brief Queue a watched status update job. + + \param[in] item Item to update watched status for + \param[in] watched New watched status + */ void MarkAsWatched(const CFileItemPtr &item, bool watched); + /*! + \brief Adds the given job to the queue. + + \param[in] job Video library job to be queued. + */ void AddJob(CVideoLibraryJob *job); + + /*! + \brief Cancels the given job and removes it from the queue. + + \param[in] job Video library job to be canceld and removed from the queue. + */ void CancelJob(CVideoLibraryJob *job); + + /*! + \brief Cancels all running and queued jobs. + */ void CancelAllJobs(); + /*! + \brief Whether any jobs are running or not. + */ bool IsRunning() const; protected: diff --git a/xbmc/video/jobs/VideoLibraryCleaningJob.h b/xbmc/video/jobs/VideoLibraryCleaningJob.h index 73ea0a89c56be..429a541ab80c8 100644 --- a/xbmc/video/jobs/VideoLibraryCleaningJob.h +++ b/xbmc/video/jobs/VideoLibraryCleaningJob.h @@ -25,10 +25,26 @@ class CGUIDialogProgressBarHandle; +/*! + \brief Video library job implementation for cleaning the video library. +*/ class CVideoLibraryCleaningJob : public CVideoLibraryProgressJob { public: + /*! + \brief Creates a new video library cleaning job for the given paths. + + \param[in] paths Set with database IDs of paths to be cleaned + \param[in] showDialog Whether to show a modal dialog or not + */ CVideoLibraryCleaningJob(const std::set& paths = std::set(), bool showDialog = false); + + /*! + \brief Creates a new video library cleaning job for the given paths. + + \param[in] paths Set with database IDs of paths to be cleaned + \param[in] progressBar Progress bar to be used to display the cleaning progress + */ CVideoLibraryCleaningJob(const std::set& paths, CGUIDialogProgressBarHandle* progressBar); virtual ~CVideoLibraryCleaningJob(); diff --git a/xbmc/video/jobs/VideoLibraryJob.h b/xbmc/video/jobs/VideoLibraryJob.h index 502ddbcc78842..ff5b8598c4771 100644 --- a/xbmc/video/jobs/VideoLibraryJob.h +++ b/xbmc/video/jobs/VideoLibraryJob.h @@ -23,12 +23,25 @@ class CVideoDatabase; +/*! + \brief Basic implementation/interface of a CJob which interacts with the + video database. + */ class CVideoLibraryJob : public CJob { public: virtual ~CVideoLibraryJob(); + /*! + \brief Whether the job can be cancelled or not. + */ virtual bool CanBeCancelled() const { return false; } + + /*! + \brief Tries to cancel the running job. + + \return True if the job was cancelled, false otherwise + */ virtual bool Cancel() { return false; } // implementation of CJob @@ -39,5 +52,11 @@ class CVideoLibraryJob : public CJob protected: CVideoLibraryJob(); + /*! + \brief Worker method to be implemented by an actual implementation. + + \param[in] db Already open video database to be used for interaction + \return True if the process succeeded, false otherwise + */ virtual bool Work(CVideoDatabase &db) = 0; }; diff --git a/xbmc/video/jobs/VideoLibraryMarkWatchedJob.h b/xbmc/video/jobs/VideoLibraryMarkWatchedJob.h index 59a4dcfd09cc8..995d23a959d92 100644 --- a/xbmc/video/jobs/VideoLibraryMarkWatchedJob.h +++ b/xbmc/video/jobs/VideoLibraryMarkWatchedJob.h @@ -22,9 +22,18 @@ #include "FileItem.h" #include "video/jobs/VideoLibraryJob.h" +/*! + \brief Video library job implementation for marking items as watched/unwatched. + */ class CVideoLibraryMarkWatchedJob : public CVideoLibraryJob { public: + /*! + \brief Creates a new video library scanning job. + + \param[in] item Item to be marked as watched/unwatched + \param[in] mark Whether to mark the item as watched or unwatched + */ CVideoLibraryMarkWatchedJob(const CFileItemPtr &item, bool mark); virtual ~CVideoLibraryMarkWatchedJob(); diff --git a/xbmc/video/jobs/VideoLibraryProgressJob.h b/xbmc/video/jobs/VideoLibraryProgressJob.h index b9e69ab64be21..9832f167469fb 100644 --- a/xbmc/video/jobs/VideoLibraryProgressJob.h +++ b/xbmc/video/jobs/VideoLibraryProgressJob.h @@ -22,6 +22,9 @@ #include "utils/ProgressJob.h" #include "video/jobs/VideoLibraryJob.h" +/*! + \brief Combined base implementation of a video library job with a progress bar. + */ class CVideoLibraryProgressJob : public CProgressJob, public CVideoLibraryJob { public: diff --git a/xbmc/video/jobs/VideoLibraryScanningJob.h b/xbmc/video/jobs/VideoLibraryScanningJob.h index ec7065649c124..d858692378b0a 100644 --- a/xbmc/video/jobs/VideoLibraryScanningJob.h +++ b/xbmc/video/jobs/VideoLibraryScanningJob.h @@ -24,9 +24,22 @@ #include "video/VideoInfoScanner.h" #include "video/jobs/VideoLibraryJob.h" +/*! + \brief Video library job implementation for scanning items. + + Uses CVideoInfoScanner for the whole filesystem scanning and can be run with + or without a visible progress bar. + */ class CVideoLibraryScanningJob : public CVideoLibraryJob { public: + /*! + \brief Creates a new video library scanning job. + + \param[in] directory Directory to be scanned for new items + \param[in] scanAll Whether to scan all items or not + \param[in] showProgress Whether to show a progress bar or not + */ CVideoLibraryScanningJob(const std::string& directory, bool scanAll = false, bool showProgress = true); virtual ~CVideoLibraryScanningJob(); From a83f52ced6c917361f043f1af6737429f2f7dfed Mon Sep 17 00:00:00 2001 From: montellese Date: Sun, 1 Feb 2015 12:46:18 +0100 Subject: [PATCH 12/13] [win32] update VS project files --- project/VS2010Express/XBMC.vcxproj | 16 ++++++- project/VS2010Express/XBMC.vcxproj.filters | 51 +++++++++++++++++++--- 2 files changed, 59 insertions(+), 8 deletions(-) diff --git a/project/VS2010Express/XBMC.vcxproj b/project/VS2010Express/XBMC.vcxproj index 7e873102bb5c6..6b55dc0caa56f 100644 --- a/project/VS2010Express/XBMC.vcxproj +++ b/project/VS2010Express/XBMC.vcxproj @@ -1001,8 +1001,8 @@ - + @@ -1145,7 +1145,7 @@ - + @@ -1161,8 +1161,14 @@ + + + + + + @@ -2037,9 +2043,15 @@ + + + + + + diff --git a/project/VS2010Express/XBMC.vcxproj.filters b/project/VS2010Express/XBMC.vcxproj.filters index 9f19d9fc19791..b668f7f9ced6b 100644 --- a/project/VS2010Express/XBMC.vcxproj.filters +++ b/project/VS2010Express/XBMC.vcxproj.filters @@ -325,6 +325,9 @@ {1bdb0045-3341-49b7-8d6f-30a53f812350} + + {f413004c-1ab9-42ce-bb1a-0636e5286a00} + @@ -3062,9 +3065,6 @@ filesystem\win32 - - utils - filesystem @@ -3110,6 +3110,27 @@ dialogs + + video\jobs + + + video + + + video\jobs + + + video\jobs + + + video\jobs + + + utils + + + video\jobs + @@ -6003,9 +6024,6 @@ filesystem\win32 - - utils - settings @@ -6051,6 +6069,27 @@ dialogs + + video\jobs + + + video + + + video\jobs + + + video\jobs + + + video\jobs + + + utils + + + video\jobs + From 99f37c4528fbfa03fbeb07d9ab847f70e4809da8 Mon Sep 17 00:00:00 2001 From: Matthias Kortstiege Date: Fri, 13 Feb 2015 08:11:32 +0100 Subject: [PATCH 13/13] [osx/ios] sync xcode project --- Kodi.xcodeproj/project.pbxproj | 98 ++++++++++++++++++++++++++++------ 1 file changed, 83 insertions(+), 15 deletions(-) diff --git a/Kodi.xcodeproj/project.pbxproj b/Kodi.xcodeproj/project.pbxproj index c5926bff223e9..567c0622e3a57 100644 --- a/Kodi.xcodeproj/project.pbxproj +++ b/Kodi.xcodeproj/project.pbxproj @@ -182,12 +182,33 @@ 3802709A13D5A653009493DD /* SystemClock.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3802709813D5A653009493DD /* SystemClock.cpp */; }; 384718D81325BA04000486D6 /* XBDateTime.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 384718D61325BA04000486D6 /* XBDateTime.cpp */; }; 38F4E57013CCCB3B00664821 /* Implementation.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 38F4E56C13CCCB3B00664821 /* Implementation.cpp */; }; - 395F6DE21A81FACF0088CC74 /* HTTPImageTransformationHandler.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 395F6DE01A81FACF0088CC74 /* HTTPImageTransformationHandler.cpp */; }; - 395F6DE31A81FACF0088CC74 /* HTTPImageTransformationHandler.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 395F6DE01A81FACF0088CC74 /* HTTPImageTransformationHandler.cpp */; }; - 395F6DE41A81FACF0088CC74 /* HTTPImageTransformationHandler.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 395F6DE01A81FACF0088CC74 /* HTTPImageTransformationHandler.cpp */; }; 395F6DDD1A8133360088CC74 /* GUIDialogSimpleMenu.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 395F6DDB1A8133360088CC74 /* GUIDialogSimpleMenu.cpp */; }; 395F6DDE1A8133360088CC74 /* GUIDialogSimpleMenu.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 395F6DDB1A8133360088CC74 /* GUIDialogSimpleMenu.cpp */; }; 395F6DDF1A8133360088CC74 /* GUIDialogSimpleMenu.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 395F6DDB1A8133360088CC74 /* GUIDialogSimpleMenu.cpp */; }; + 395F6DE21A81FACF0088CC74 /* HTTPImageTransformationHandler.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 395F6DE01A81FACF0088CC74 /* HTTPImageTransformationHandler.cpp */; }; + 395F6DE31A81FACF0088CC74 /* HTTPImageTransformationHandler.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 395F6DE01A81FACF0088CC74 /* HTTPImageTransformationHandler.cpp */; }; + 395F6DE41A81FACF0088CC74 /* HTTPImageTransformationHandler.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 395F6DE01A81FACF0088CC74 /* HTTPImageTransformationHandler.cpp */; }; + 3994425B1A8DD8D0006C39E9 /* ProgressJob.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 399442591A8DD8D0006C39E9 /* ProgressJob.cpp */; }; + 3994425C1A8DD8D0006C39E9 /* ProgressJob.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 399442591A8DD8D0006C39E9 /* ProgressJob.cpp */; }; + 3994425D1A8DD8D0006C39E9 /* ProgressJob.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 399442591A8DD8D0006C39E9 /* ProgressJob.cpp */; }; + 3994426E1A8DD920006C39E9 /* VideoLibraryCleaningJob.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 399442611A8DD920006C39E9 /* VideoLibraryCleaningJob.cpp */; }; + 3994426F1A8DD920006C39E9 /* VideoLibraryCleaningJob.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 399442611A8DD920006C39E9 /* VideoLibraryCleaningJob.cpp */; }; + 399442701A8DD920006C39E9 /* VideoLibraryCleaningJob.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 399442611A8DD920006C39E9 /* VideoLibraryCleaningJob.cpp */; }; + 399442711A8DD920006C39E9 /* VideoLibraryJob.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 399442631A8DD920006C39E9 /* VideoLibraryJob.cpp */; }; + 399442721A8DD920006C39E9 /* VideoLibraryJob.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 399442631A8DD920006C39E9 /* VideoLibraryJob.cpp */; }; + 399442731A8DD920006C39E9 /* VideoLibraryJob.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 399442631A8DD920006C39E9 /* VideoLibraryJob.cpp */; }; + 399442741A8DD920006C39E9 /* VideoLibraryMarkWatchedJob.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 399442651A8DD920006C39E9 /* VideoLibraryMarkWatchedJob.cpp */; }; + 399442751A8DD920006C39E9 /* VideoLibraryMarkWatchedJob.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 399442651A8DD920006C39E9 /* VideoLibraryMarkWatchedJob.cpp */; }; + 399442761A8DD920006C39E9 /* VideoLibraryMarkWatchedJob.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 399442651A8DD920006C39E9 /* VideoLibraryMarkWatchedJob.cpp */; }; + 399442771A8DD920006C39E9 /* VideoLibraryProgressJob.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 399442671A8DD920006C39E9 /* VideoLibraryProgressJob.cpp */; }; + 399442781A8DD920006C39E9 /* VideoLibraryProgressJob.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 399442671A8DD920006C39E9 /* VideoLibraryProgressJob.cpp */; }; + 399442791A8DD920006C39E9 /* VideoLibraryProgressJob.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 399442671A8DD920006C39E9 /* VideoLibraryProgressJob.cpp */; }; + 3994427A1A8DD920006C39E9 /* VideoLibraryScanningJob.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 399442691A8DD920006C39E9 /* VideoLibraryScanningJob.cpp */; }; + 3994427B1A8DD920006C39E9 /* VideoLibraryScanningJob.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 399442691A8DD920006C39E9 /* VideoLibraryScanningJob.cpp */; }; + 3994427C1A8DD920006C39E9 /* VideoLibraryScanningJob.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 399442691A8DD920006C39E9 /* VideoLibraryScanningJob.cpp */; }; + 3994427F1A8DD96F006C39E9 /* VideoLibraryQueue.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3994427D1A8DD96F006C39E9 /* VideoLibraryQueue.cpp */; }; + 399442801A8DD96F006C39E9 /* VideoLibraryQueue.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3994427D1A8DD96F006C39E9 /* VideoLibraryQueue.cpp */; }; + 399442811A8DD96F006C39E9 /* VideoLibraryQueue.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3994427D1A8DD96F006C39E9 /* VideoLibraryQueue.cpp */; }; 42DAC16E1A6E789E0066B4C8 /* PVRActionListener.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 42DAC16C1A6E789E0066B4C8 /* PVRActionListener.cpp */; }; 42DAC16F1A6E789E0066B4C8 /* PVRActionListener.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 42DAC16C1A6E789E0066B4C8 /* PVRActionListener.cpp */; }; 42DAC1701A6E789E0066B4C8 /* PVRActionListener.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 42DAC16C1A6E789E0066B4C8 /* PVRActionListener.cpp */; }; @@ -664,9 +685,6 @@ AE84CB5A15A5B8A600A3810E /* TagLibVFSStream.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AE84CB5915A5B8A600A3810E /* TagLibVFSStream.cpp */; }; AE89ACA61621DAB800E17DBC /* DVDDemuxBXA.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AE89ACA41621DAB800E17DBC /* DVDDemuxBXA.cpp */; }; AEC0083115ACAC6E0099888C /* TagLoaderTagLib.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AEC0083015ACAC6E0099888C /* TagLoaderTagLib.cpp */; }; - B5011E3C19AA4989005ADF89 /* MarkWatchedJob.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B5011E3B19AA4989005ADF89 /* MarkWatchedJob.cpp */; }; - B5011E3D19AA4989005ADF89 /* MarkWatchedJob.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B5011E3B19AA4989005ADF89 /* MarkWatchedJob.cpp */; }; - B5011E3E19AA4989005ADF89 /* MarkWatchedJob.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B5011E3B19AA4989005ADF89 /* MarkWatchedJob.cpp */; }; B5011E4119AF3B56005ADF89 /* PosixFile.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B5011E3F19AF3B56005ADF89 /* PosixFile.cpp */; }; B5011E4219AF3B56005ADF89 /* PosixFile.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B5011E3F19AF3B56005ADF89 /* PosixFile.cpp */; }; B5011E4319AF3B56005ADF89 /* PosixFile.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B5011E3F19AF3B56005ADF89 /* PosixFile.cpp */; }; @@ -3614,10 +3632,24 @@ 38F4E56C13CCCB3B00664821 /* Implementation.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Implementation.cpp; sourceTree = ""; }; 38F4E56D13CCCB3B00664821 /* README.platform */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = README.platform; sourceTree = ""; }; 38F4E56E13CCCB3B00664821 /* ThreadLocal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ThreadLocal.h; sourceTree = ""; }; - 395F6DE01A81FACF0088CC74 /* HTTPImageTransformationHandler.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = HTTPImageTransformationHandler.cpp; sourceTree = ""; }; - 395F6DE11A81FACF0088CC74 /* HTTPImageTransformationHandler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HTTPImageTransformationHandler.h; sourceTree = ""; }; 395F6DDB1A8133360088CC74 /* GUIDialogSimpleMenu.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GUIDialogSimpleMenu.cpp; sourceTree = ""; }; 395F6DDC1A8133360088CC74 /* GUIDialogSimpleMenu.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GUIDialogSimpleMenu.h; sourceTree = ""; }; + 395F6DE01A81FACF0088CC74 /* HTTPImageTransformationHandler.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = HTTPImageTransformationHandler.cpp; sourceTree = ""; }; + 395F6DE11A81FACF0088CC74 /* HTTPImageTransformationHandler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HTTPImageTransformationHandler.h; sourceTree = ""; }; + 399442591A8DD8D0006C39E9 /* ProgressJob.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ProgressJob.cpp; sourceTree = ""; }; + 3994425A1A8DD8D0006C39E9 /* ProgressJob.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ProgressJob.h; sourceTree = ""; }; + 399442611A8DD920006C39E9 /* VideoLibraryCleaningJob.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = VideoLibraryCleaningJob.cpp; sourceTree = ""; }; + 399442621A8DD920006C39E9 /* VideoLibraryCleaningJob.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VideoLibraryCleaningJob.h; sourceTree = ""; }; + 399442631A8DD920006C39E9 /* VideoLibraryJob.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = VideoLibraryJob.cpp; sourceTree = ""; }; + 399442641A8DD920006C39E9 /* VideoLibraryJob.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VideoLibraryJob.h; sourceTree = ""; }; + 399442651A8DD920006C39E9 /* VideoLibraryMarkWatchedJob.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = VideoLibraryMarkWatchedJob.cpp; sourceTree = ""; }; + 399442661A8DD920006C39E9 /* VideoLibraryMarkWatchedJob.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VideoLibraryMarkWatchedJob.h; sourceTree = ""; }; + 399442671A8DD920006C39E9 /* VideoLibraryProgressJob.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = VideoLibraryProgressJob.cpp; sourceTree = ""; }; + 399442681A8DD920006C39E9 /* VideoLibraryProgressJob.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VideoLibraryProgressJob.h; sourceTree = ""; }; + 399442691A8DD920006C39E9 /* VideoLibraryScanningJob.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = VideoLibraryScanningJob.cpp; sourceTree = ""; }; + 3994426A1A8DD920006C39E9 /* VideoLibraryScanningJob.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VideoLibraryScanningJob.h; sourceTree = ""; }; + 3994427D1A8DD96F006C39E9 /* VideoLibraryQueue.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = VideoLibraryQueue.cpp; sourceTree = ""; }; + 3994427E1A8DD96F006C39E9 /* VideoLibraryQueue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VideoLibraryQueue.h; sourceTree = ""; }; 42DAC16B1A6E780C0066B4C8 /* IActionListener.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IActionListener.h; sourceTree = ""; }; 42DAC16C1A6E789E0066B4C8 /* PVRActionListener.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PVRActionListener.cpp; sourceTree = ""; }; 42DAC16D1A6E789E0066B4C8 /* PVRActionListener.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PVRActionListener.h; sourceTree = ""; }; @@ -4225,8 +4257,6 @@ AE89ACA51621DAB800E17DBC /* DVDDemuxBXA.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DVDDemuxBXA.h; sourceTree = ""; }; AEC0083015ACAC6E0099888C /* TagLoaderTagLib.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TagLoaderTagLib.cpp; sourceTree = ""; }; AEC0083315ACAC7C0099888C /* TagLoaderTagLib.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TagLoaderTagLib.h; sourceTree = ""; }; - B5011E3A19AA496D005ADF89 /* MarkWatchedJob.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MarkWatchedJob.h; sourceTree = ""; }; - B5011E3B19AA4989005ADF89 /* MarkWatchedJob.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MarkWatchedJob.cpp; sourceTree = ""; }; B5011E3F19AF3B56005ADF89 /* PosixFile.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PosixFile.cpp; sourceTree = ""; }; B5011E4019AF3B56005ADF89 /* PosixFile.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PosixFile.h; sourceTree = ""; }; B5101B5719DFF8DD00294D1E /* BlurayFile.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = BlurayFile.cpp; sourceTree = ""; }; @@ -6405,6 +6435,23 @@ path = pthreads; sourceTree = ""; }; + 3994425F1A8DD920006C39E9 /* jobs */ = { + isa = PBXGroup; + children = ( + 399442611A8DD920006C39E9 /* VideoLibraryCleaningJob.cpp */, + 399442621A8DD920006C39E9 /* VideoLibraryCleaningJob.h */, + 399442631A8DD920006C39E9 /* VideoLibraryJob.cpp */, + 399442641A8DD920006C39E9 /* VideoLibraryJob.h */, + 399442651A8DD920006C39E9 /* VideoLibraryMarkWatchedJob.cpp */, + 399442661A8DD920006C39E9 /* VideoLibraryMarkWatchedJob.h */, + 399442671A8DD920006C39E9 /* VideoLibraryProgressJob.cpp */, + 399442681A8DD920006C39E9 /* VideoLibraryProgressJob.h */, + 399442691A8DD920006C39E9 /* VideoLibraryScanningJob.cpp */, + 3994426A1A8DD920006C39E9 /* VideoLibraryScanningJob.h */, + ); + path = jobs; + sourceTree = ""; + }; 430C880812D649B10098821A /* powermanagement */ = { isa = PBXGroup; children = ( @@ -6794,6 +6841,7 @@ 43FAC85D12D62F4300F67914 /* video */ = { isa = PBXGroup; children = ( + 3994425F1A8DD920006C39E9 /* jobs */, 43FAC88612D6363B00F67914 /* dialogs */, DFA0E8C619FD6BFC00269A92 /* videosync */, 43FAC88812D6364800F67914 /* windows */, @@ -6818,6 +6866,8 @@ E38E1E960D25F9FD00618676 /* VideoInfoScanner.h */, E38E1E970D25F9FD00618676 /* VideoInfoTag.cpp */, E38E1E980D25F9FD00618676 /* VideoInfoTag.h */, + 3994427D1A8DD96F006C39E9 /* VideoLibraryQueue.cpp */, + 3994427E1A8DD96F006C39E9 /* VideoLibraryQueue.h */, F59876BF0FBA351D008EF4FB /* VideoReferenceClock.cpp */, F59876BE0FBA351D008EF4FB /* VideoReferenceClock.h */, 7CC30DBE16291C2C003E7579 /* VideoThumbLoader.cpp */, @@ -9288,9 +9338,7 @@ children = ( DF56EF221A798A5E00CAAEFB /* HttpRangeUtils.cpp */, DF56EF231A798A5E00CAAEFB /* HttpRangeUtils.h */, - B5011E3B19AA4989005ADF89 /* MarkWatchedJob.cpp */, B542632E19917D3500726998 /* params_check_macros.h */, - B5011E3A19AA496D005ADF89 /* MarkWatchedJob.h */, F5CC22FB18150065006B5E91 /* ActorProtocol.cpp */, F5CC22FC18150065006B5E91 /* ActorProtocol.h */, E38E1E230D25F9FD00618676 /* AlarmClock.cpp */, @@ -9390,6 +9438,8 @@ E38E1E720D25F9FD00618676 /* PerformanceStats.h */, F5ED908C15538E2300842059 /* POUtils.cpp */, F5ED908D15538E2300842059 /* POUtils.h */, + 399442591A8DD8D0006C39E9 /* ProgressJob.cpp */, + 3994425A1A8DD8D0006C39E9 /* ProgressJob.h */, 18ACF84113596C9B00B67371 /* RecentlyAddedJob.cpp */, 18ACF84213596C9B00B67371 /* RecentlyAddedJob.h */, E38E1E730D25F9FD00618676 /* RegExp.cpp */, @@ -10248,6 +10298,7 @@ buildActionMask = 2147483647; files = ( E38E1F370D25F9FD00618676 /* Application.cpp in Sources */, + 399442771A8DD920006C39E9 /* VideoLibraryProgressJob.cpp in Sources */, E38E1F380D25F9FD00618676 /* ApplicationMessenger.cpp in Sources */, E38E1F3C0D25F9FD00618676 /* Autorun.cpp in Sources */, E38E1F3D0D25F9FD00618676 /* AutoSwitch.cpp in Sources */, @@ -10423,6 +10474,7 @@ E38E209A0D25F9FD00618676 /* GUIDialogSongInfo.cpp in Sources */, E38E209B0D25F9FD00618676 /* GUIDialogSubMenu.cpp in Sources */, E38E209D0D25F9FD00618676 /* GUIDialogVideoBookmarks.cpp in Sources */, + 3994426E1A8DD920006C39E9 /* VideoLibraryCleaningJob.cpp in Sources */, E38E20A00D25F9FD00618676 /* GUIDialogVisualisationPresetList.cpp in Sources */, E38E20A20D25F9FD00618676 /* GUIDialogVolumeBar.cpp in Sources */, E38E20A30D25F9FD00618676 /* GUIDialogYesNo.cpp in Sources */, @@ -10783,6 +10835,7 @@ 18B7C7DC1294222E009E7A26 /* GUIShader.cpp in Sources */, 18B7C7DD1294222E009E7A26 /* GUISliderControl.cpp in Sources */, 18B7C7DF1294222E009E7A26 /* GUISpinControl.cpp in Sources */, + 399442711A8DD920006C39E9 /* VideoLibraryJob.cpp in Sources */, 18B7C7E01294222E009E7A26 /* GUISpinControlEx.cpp in Sources */, 18B7C7E21294222E009E7A26 /* GUIStaticItem.cpp in Sources */, 18B7C7E31294222E009E7A26 /* GUITextBox.cpp in Sources */, @@ -10927,6 +10980,7 @@ DF93D6991444A8B1007C6459 /* AFPFile.cpp in Sources */, DF93D69A1444A8B1007C6459 /* DirectoryCache.cpp in Sources */, DF93D69B1444A8B1007C6459 /* FileCache.cpp in Sources */, + 3994427A1A8DD920006C39E9 /* VideoLibraryScanningJob.cpp in Sources */, DF93D69C1444A8B1007C6459 /* CDDAFile.cpp in Sources */, DF93D69D1444A8B1007C6459 /* CurlFile.cpp in Sources */, DF93D69E1444A8B1007C6459 /* DAAPFile.cpp in Sources */, @@ -11026,6 +11080,7 @@ DF830D0C15BB260C00602BE6 /* GUIDialogKeyboardGeneric.cpp in Sources */, DF830D1215BB262700602BE6 /* GUIKeyboardFactory.cpp in Sources */, 36A9466315CF1FA600727135 /* DbUrl.cpp in Sources */, + 3994427F1A8DD96F006C39E9 /* VideoLibraryQueue.cpp in Sources */, 36A9466715CF1FD200727135 /* MusicDbUrl.cpp in Sources */, 36A9466A15CF1FED00727135 /* UrlOptions.cpp in Sources */, 36A9466D15CF201F00727135 /* VideoDbUrl.cpp in Sources */, @@ -11071,6 +11126,7 @@ DFB25D40163D4743006C4A48 /* ModuleXbmcvfs.cpp in Sources */, DFB25D41163D4743006C4A48 /* Monitor.cpp in Sources */, DFB25D42163D4743006C4A48 /* Player.cpp in Sources */, + 3994425B1A8DD8D0006C39E9 /* ProgressJob.cpp in Sources */, DFB25D43163D4743006C4A48 /* PlayList.cpp in Sources */, DFB25D44163D4743006C4A48 /* String.cpp in Sources */, DFB25D45163D4743006C4A48 /* Window.cpp in Sources */, @@ -11252,6 +11308,7 @@ DF4BF0161A4EF30F0053AC56 /* cc_decoder708.cpp in Sources */, 7CCDA7AF192756250074CF51 /* NptDebug.cpp in Sources */, 7CCDA7B8192756250074CF51 /* NptDigest.cpp in Sources */, + 399442741A8DD920006C39E9 /* VideoLibraryMarkWatchedJob.cpp in Sources */, 7CCDA7BB192756250074CF51 /* NptDynamicLibraries.cpp in Sources */, 7CCDA7BE192756250074CF51 /* NptFile.cpp in Sources */, 7CCDA7C7192756250074CF51 /* NptHash.cpp in Sources */, @@ -11276,7 +11333,6 @@ 7CCDA85A192756250074CF51 /* NptUtils.cpp in Sources */, 7CCDA863192756250074CF51 /* NptXml.cpp in Sources */, 7CCDA86C192756250074CF51 /* NptZip.cpp in Sources */, - B5011E3C19AA4989005ADF89 /* MarkWatchedJob.cpp in Sources */, DF56EF1F1A798A3F00CAAEFB /* HTTPFileHandler.cpp in Sources */, 7CCDAA82192756250074CF51 /* NptPosixDynamicLibraries.cpp in Sources */, 7CCDAA85192756250074CF51 /* NptPosixEnvironment.cpp in Sources */, @@ -11377,6 +11433,7 @@ DFF0F13617528350002DA3A4 /* Exception.cpp in Sources */, DFF0F13717528350002DA3A4 /* ilog.cpp in Sources */, DFF0F13817528350002DA3A4 /* AEEncoderFFmpeg.cpp in Sources */, + 399442791A8DD920006C39E9 /* VideoLibraryProgressJob.cpp in Sources */, DFF0F13E17528350002DA3A4 /* AEBitstreamPacker.cpp in Sources */, DFF0F13F17528350002DA3A4 /* AEBuffer.cpp in Sources */, DFF0F14017528350002DA3A4 /* AEChannelInfo.cpp in Sources */, @@ -11659,6 +11716,7 @@ DFF0F26117528350002DA3A4 /* DirectoryNodeRoot.cpp in Sources */, DFF0F26217528350002DA3A4 /* DirectoryNodeSeasons.cpp in Sources */, DFF0F26317528350002DA3A4 /* DirectoryNodeTitleMovies.cpp in Sources */, + 3994425D1A8DD8D0006C39E9 /* ProgressJob.cpp in Sources */, DFF0F26417528350002DA3A4 /* DirectoryNodeTitleMusicVideos.cpp in Sources */, DFF0F26517528350002DA3A4 /* DirectoryNodeTitleTvShows.cpp in Sources */, DFF0F26617528350002DA3A4 /* DirectoryNodeTvShowsOverview.cpp in Sources */, @@ -11728,6 +11786,7 @@ DFF0F2A517528350002DA3A4 /* GUISelectButtonControl.cpp in Sources */, DFF0F2A617528350002DA3A4 /* GUISettingsSliderControl.cpp in Sources */, DFF0F2A717528350002DA3A4 /* GUIShader.cpp in Sources */, + 399442811A8DD96F006C39E9 /* VideoLibraryQueue.cpp in Sources */, DFF0F2A817528350002DA3A4 /* GUISliderControl.cpp in Sources */, DFF0F2A917528350002DA3A4 /* GUISpinControl.cpp in Sources */, DFF0F2AA17528350002DA3A4 /* GUISpinControlEx.cpp in Sources */, @@ -11949,6 +12008,7 @@ DFF0F38117528350002DA3A4 /* GUIDialogPVRTimerSettings.cpp in Sources */, DFF0F38217528350002DA3A4 /* PVRRecording.cpp in Sources */, DFF0F38317528350002DA3A4 /* PVRRecordings.cpp in Sources */, + 3994427C1A8DD920006C39E9 /* VideoLibraryScanningJob.cpp in Sources */, DFF0F38417528350002DA3A4 /* PVRTimerInfoTag.cpp in Sources */, DFF0F38517528350002DA3A4 /* PVRTimers.cpp in Sources */, DFF0F38617528350002DA3A4 /* GUIViewStatePVR.cpp in Sources */, @@ -11988,7 +12048,6 @@ DFF0F3B317528350002DA3A4 /* Implementation.cpp in Sources */, DFF0F3B417528350002DA3A4 /* Atomics.cpp in Sources */, DFF0F3B517528350002DA3A4 /* Event.cpp in Sources */, - B5011E3E19AA4989005ADF89 /* MarkWatchedJob.cpp in Sources */, DFF0F3B617528350002DA3A4 /* LockFree.cpp in Sources */, DFF0F3B717528350002DA3A4 /* SystemClock.cpp in Sources */, DFF0F3B817528350002DA3A4 /* Thread.cpp in Sources */, @@ -12026,6 +12085,7 @@ DFF0F3DA17528350002DA3A4 /* JSONVariantWriter.cpp in Sources */, DFF0F3DB17528350002DA3A4 /* LabelFormatter.cpp in Sources */, DFF0F3DC17528350002DA3A4 /* LangCodeExpander.cpp in Sources */, + 399442731A8DD920006C39E9 /* VideoLibraryJob.cpp in Sources */, DFF0F3DD17528350002DA3A4 /* LegacyPathTranslation.cpp in Sources */, DFF0F3DE17528350002DA3A4 /* log.cpp in Sources */, DFF0F3DF17528350002DA3A4 /* md5.cpp in Sources */, @@ -12086,6 +12146,7 @@ DFF0F41517528350002DA3A4 /* VideoInfoTag.cpp in Sources */, DFF0F41617528350002DA3A4 /* VideoReferenceClock.cpp in Sources */, DFF0F41717528350002DA3A4 /* VideoThumbLoader.cpp in Sources */, + 399442701A8DD920006C39E9 /* VideoLibraryCleaningJob.cpp in Sources */, DFF0F41817528350002DA3A4 /* GUIViewControl.cpp in Sources */, DFF0F41917528350002DA3A4 /* GUIViewState.cpp in Sources */, DFF0F41A17528350002DA3A4 /* ViewDatabase.cpp in Sources */, @@ -12139,6 +12200,7 @@ DFF0F45117528350002DA3A4 /* XBDateTime.cpp in Sources */, DFF0F45217528350002DA3A4 /* xbmc.cpp in Sources */, DFF0F45317528350002DA3A4 /* XbmcContext.cpp in Sources */, + 399442761A8DD920006C39E9 /* VideoLibraryMarkWatchedJob.cpp in Sources */, DFF0F45417528350002DA3A4 /* MouseStat.cpp in Sources */, DFF0F45517528350002DA3A4 /* Addon.cpp in Sources */, DFF0F45617528350002DA3A4 /* AddonCallback.cpp in Sources */, @@ -12774,8 +12836,10 @@ E4991302174E5DAD00741B6D /* GUIListLabel.cpp in Sources */, E4991303174E5DAD00741B6D /* GUIMessage.cpp in Sources */, E4991304174E5DAD00741B6D /* GUIMoverControl.cpp in Sources */, + 399442751A8DD920006C39E9 /* VideoLibraryMarkWatchedJob.cpp in Sources */, E4991305174E5DAD00741B6D /* GUIMultiImage.cpp in Sources */, E4991306174E5DAD00741B6D /* GUIMultiSelectText.cpp in Sources */, + 3994427B1A8DD920006C39E9 /* VideoLibraryScanningJob.cpp in Sources */, E4991307174E5DAD00741B6D /* GUIPanelContainer.cpp in Sources */, E4991308174E5DAD00741B6D /* GUIProgressControl.cpp in Sources */, E4991309174E5DAD00741B6D /* GUIRadioButtonControl.cpp in Sources */, @@ -12787,6 +12851,7 @@ E499130F174E5DAD00741B6D /* GUISettingsSliderControl.cpp in Sources */, E4991310174E5DAD00741B6D /* GUIShader.cpp in Sources */, E4991311174E5DAD00741B6D /* GUISliderControl.cpp in Sources */, + 3994426F1A8DD920006C39E9 /* VideoLibraryCleaningJob.cpp in Sources */, E4991312174E5DAD00741B6D /* GUISpinControl.cpp in Sources */, E4991313174E5DAD00741B6D /* GUISpinControlEx.cpp in Sources */, E4991314174E5DAD00741B6D /* GUIStaticItem.cpp in Sources */, @@ -12913,6 +12978,7 @@ E49913A6174E5F2100741B6D /* HTTPWebinterfaceAddonsHandler.cpp in Sources */, E49913A7174E5F2100741B6D /* HTTPWebinterfaceHandler.cpp in Sources */, E49913A8174E5F2100741B6D /* IHTTPRequestHandler.cpp in Sources */, + 3994425C1A8DD8D0006C39E9 /* ProgressJob.cpp in Sources */, E49913A9174E5F2100741B6D /* NetworkLinux.cpp in Sources */, E49913AA174E5F2100741B6D /* ZeroconfBrowserOSX.cpp in Sources */, E49913AB174E5F2100741B6D /* ZeroconfOSX.cpp in Sources */, @@ -13037,6 +13103,7 @@ E4991430174E603C00741B6D /* VideoSettings.cpp in Sources */, E4991431174E604300741B6D /* DarwinStorageProvider.cpp in Sources */, E4991432174E604300741B6D /* AutorunMediaJob.cpp in Sources */, + 399442721A8DD920006C39E9 /* VideoLibraryJob.cpp in Sources */, E4991433174E604300741B6D /* cdioSupport.cpp in Sources */, E4991434174E604300741B6D /* DetectDVDType.cpp in Sources */, E4991435174E604300741B6D /* IoSupport.cpp in Sources */, @@ -13049,6 +13116,7 @@ E499143C174E604700741B6D /* Thread.cpp in Sources */, E499143D174E604700741B6D /* Timer.cpp in Sources */, E499143E174E605900741B6D /* AlarmClock.cpp in Sources */, + 399442781A8DD920006C39E9 /* VideoLibraryProgressJob.cpp in Sources */, DF4BF01E1A4EF3410053AC56 /* DVDDemuxCC.cpp in Sources */, E499143F174E605900741B6D /* AliasShortcutUtils.cpp in Sources */, E4991440174E605900741B6D /* Archive.cpp in Sources */, @@ -13152,6 +13220,7 @@ E49914A2174E607200741B6D /* GUIMediaWindow.cpp in Sources */, E49914A3174E607200741B6D /* GUIWindowDebugInfo.cpp in Sources */, E49914A4174E607200741B6D /* GUIWindowFileManager.cpp in Sources */, + 399442801A8DD96F006C39E9 /* VideoLibraryQueue.cpp in Sources */, E49914A5174E607200741B6D /* GUIWindowHome.cpp in Sources */, E49914A6174E607200741B6D /* GUIWindowLoginScreen.cpp in Sources */, E49914A7174E607200741B6D /* GUIWindowPointer.cpp in Sources */, @@ -13381,7 +13450,6 @@ 7CCDA864192756250074CF51 /* NptXml.cpp in Sources */, 7CCDA86D192756250074CF51 /* NptZip.cpp in Sources */, B5011E4219AF3B56005ADF89 /* PosixFile.cpp in Sources */, - B5011E3D19AA4989005ADF89 /* MarkWatchedJob.cpp in Sources */, 7CCDAA83192756250074CF51 /* NptPosixDynamicLibraries.cpp in Sources */, 7CCDAA86192756250074CF51 /* NptPosixEnvironment.cpp in Sources */, 7CCDAA8C192756250074CF51 /* NptPosixNetwork.cpp in Sources */,