Added playlist import (and sync)from m3u files, ref #391

This commit is contained in:
emeric
2024-12-18 14:15:25 +01:00
parent ec20c9bfa6
commit 3661eaccb6
95 changed files with 3439 additions and 1634 deletions
+5 -5
View File
@@ -26,9 +26,9 @@
namespace lms::core
{
IOContextRunner::IOContextRunner(boost::asio::io_service& ioService, std::size_t threadCount, std::string_view name)
: _ioService{ ioService }
, _work{ ioService }
IOContextRunner::IOContextRunner(boost::asio::io_context& ioContext, std::size_t threadCount, std::string_view name)
: _ioContext{ ioContext }
, _work{ ioContext }
{
LMS_LOG(UTILS, INFO, "Starting IO context with " << threadCount << " threads...");
@@ -50,7 +50,7 @@ namespace lms::core
try
{
_ioService.run();
_ioContext.run();
}
catch (const std::exception& e)
{
@@ -65,7 +65,7 @@ namespace lms::core
{
LMS_LOG(UTILS, DEBUG, "Stopping IO context...");
_work.reset();
_ioService.stop();
_ioContext.stop();
LMS_LOG(UTILS, DEBUG, "IO context stopped!");
}
@@ -22,25 +22,24 @@
#include <optional>
#include <thread>
#include <boost/asio/io_service.hpp>
#include <boost/asio/io_context.hpp>
namespace lms::core
{
class IOContextRunner
{
public:
IOContextRunner(boost::asio::io_service& ioService, std::size_t threadCount, std::string_view name);
IOContextRunner(boost::asio::io_context& ioContext, std::size_t threadCount, std::string_view name);
~IOContextRunner();
IOContextRunner(const IOContextRunner&) = delete;
IOContextRunner& operator=(const IOContextRunner&) = delete;
void stop();
std::size_t getThreadCount() const;
private:
IOContextRunner(const IOContextRunner&) = delete;
IOContextRunner& operator=(const IOContextRunner&) = delete;
boost::asio::io_service& _ioService;
std::optional<boost::asio::io_service::work> _work;
boost::asio::io_context& _ioContext;
std::optional<boost::asio::io_context::work> _work;
std::vector<std::thread> _threads;
};
} // namespace lms::core