mirror of
https://github.com/badaix/snapcast.git
synced 2025-05-03 04:06:31 +02:00
Move meta_mpd.py to plug-ins directory
This commit is contained in:
parent
8d8061a946
commit
da687c1585
3 changed files with 17 additions and 7 deletions
|
@ -117,5 +117,6 @@ else()
|
||||||
install(FILES etc/snapserver.conf COMPONENT server DESTINATION ${CMAKE_INSTALL_SYSCONFDIR})
|
install(FILES etc/snapserver.conf COMPONENT server DESTINATION ${CMAKE_INSTALL_SYSCONFDIR})
|
||||||
install(FILES etc/index.html COMPONENT server DESTINATION ${CMAKE_INSTALL_DATADIR}/snapserver)
|
install(FILES etc/index.html COMPONENT server DESTINATION ${CMAKE_INSTALL_DATADIR}/snapserver)
|
||||||
install(DIRECTORY etc/snapweb/ DESTINATION ${CMAKE_INSTALL_DATADIR}/snapserver/snapweb)
|
install(DIRECTORY etc/snapweb/ DESTINATION ${CMAKE_INSTALL_DATADIR}/snapserver/snapweb)
|
||||||
|
install(DIRECTORY etc/plug-ins/ DESTINATION ${CMAKE_INSTALL_DATADIR}/snapserver/plug-ins)
|
||||||
#install(FILES ../debian/snapserver.service DESTINATION ${SYSTEMD_SERVICES_INSTALL_DIR})
|
#install(FILES ../debian/snapserver.service DESTINATION ${SYSTEMD_SERVICES_INSTALL_DIR})
|
||||||
endif()
|
endif()
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -29,6 +29,7 @@
|
||||||
// 3rd party headers
|
// 3rd party headers
|
||||||
|
|
||||||
// standard headers
|
// standard headers
|
||||||
|
#include <filesystem>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
|
|
||||||
|
|
||||||
|
@ -140,13 +141,17 @@ void StreamControl::onLog(std::string message)
|
||||||
|
|
||||||
ScriptStreamControl::ScriptStreamControl(const net::any_io_executor& executor, const std::string& script) : StreamControl(executor), script_(script)
|
ScriptStreamControl::ScriptStreamControl(const net::any_io_executor& executor, const std::string& script) : StreamControl(executor), script_(script)
|
||||||
{
|
{
|
||||||
// auto fileExists = [](const std::string& filename) {
|
namespace fs = std::filesystem;
|
||||||
// struct stat buffer;
|
if (!fs::exists(script_))
|
||||||
// return (stat(filename.c_str(), &buffer) == 0);
|
{
|
||||||
// };
|
fs::path plugin_path = "/usr/share/snapserver/plug-ins";
|
||||||
|
if (fs::exists(plugin_path / script_))
|
||||||
// if (!fileExists(script_))
|
script_ = (plugin_path / script_).native();
|
||||||
// throw SnapException("Control script not found: \"" + script_ + "\"");
|
else if (fs::exists(plugin_path / fs::path(script_).filename()))
|
||||||
|
script_ = (plugin_path / fs::path(script_).filename()).native();
|
||||||
|
else
|
||||||
|
throw SnapException("Control script not found: \"" + script_ + "\"");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue