summaryrefslogtreecommitdiff
path: root/src/lib/config.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2025-10-20 00:45:17 +0200
committerCarl Hetherington <cth@carlh.net>2026-02-16 01:20:38 +0100
commit4cb6ab669032ef0584fde63e62addfe8a71a484c (patch)
tree7f9fbc6d0981b1e247c3c89545f24d5a3a6ffaaa /src/lib/config.cc
parenteb6464c1099de3967fc8d3b7de1461da85c7e827 (diff)
Use SQLite for show playlists.
Diffstat (limited to 'src/lib/config.cc')
-rw-r--r--src/lib/config.cc21
1 files changed, 14 insertions, 7 deletions
diff --git a/src/lib/config.cc b/src/lib/config.cc
index a2469ed8a..974733e8a 100644
--- a/src/lib/config.cc
+++ b/src/lib/config.cc
@@ -31,6 +31,7 @@
#include "filter.h"
#include "log.h"
#include "ratio.h"
+#include "show_playlist_list.h"
#include "unzipper.h"
#include "variant.h"
#include "zipper.h"
@@ -189,7 +190,7 @@ Config::set_defaults()
_player_debug_log_file = boost::none;
_kdm_debug_log_file = boost::none;
_player_content_directory = boost::none;
- _player_playlist_directory = boost::none;
+ _show_playlists_file = read_path("show_playlists.sqlite3");
_player_kdm_directory = boost::none;
_audio_mapping = boost::none;
_custom_languages.clear();
@@ -615,7 +616,15 @@ try
_player_debug_log_file = f.optional_string_child("PlayerDebugLogFile");
_kdm_debug_log_file = f.optional_string_child("KDMDebugLogFile");
_player_content_directory = f.optional_string_child("PlayerContentDirectory");
- _player_playlist_directory = f.optional_string_child("PlayerPlaylistDirectory");
+ if (auto spl_dir = f.optional_string_child("PlayerPlaylistDirectory")) {
+ ShowPlaylistList spl;
+ spl.read_legacy(*spl_dir);
+ }
+ if (auto spl_file = f.optional_string_child("ShowPlaylistsFile")) {
+ _show_playlists_file = *spl_file;
+ } else {
+ _show_playlists_file = read_path("show_playlists.sqlite3");
+ }
_player_kdm_directory = f.optional_string_child("PlayerKDMDirectory");
if (f.optional_node_child("AudioMapping")) {
@@ -1101,10 +1110,8 @@ Config::write_config() const
/* [XML] PlayerContentDirectory Directory to use for player content in the dual-screen mode. */
cxml::add_text_child(root, "PlayerContentDirectory", _player_content_directory->string());
}
- if (_player_playlist_directory) {
- /* [XML] PlayerPlaylistDirectory Directory to use for player playlists in the dual-screen mode. */
- cxml::add_text_child(root, "PlayerPlaylistDirectory", _player_playlist_directory->string());
- }
+ /* [XML] ShowPlaylistsFile Filename of SQLite3 database containing show playlists for the player dual-screen mode. */
+ cxml::add_text_child(root, "ShowPlaylistsFile", _show_playlists_file.string());
if (_player_kdm_directory) {
/* [XML] PlayerKDMDirectory Directory to use for player KDMs in the dual-screen mode. */
cxml::add_text_child(root, "PlayerKDMDirectory", _player_kdm_directory->string());
@@ -1679,7 +1686,7 @@ Config::load_from_zip(boost::filesystem::path zip_file, CinemasAction action)
changed(Property::SOUND);
changed(Property::SOUND_OUTPUT);
changed(Property::PLAYER_CONTENT_DIRECTORY);
- changed(Property::PLAYER_PLAYLIST_DIRECTORY);
+ changed(Property::SHOW_PLAYLISTS_FILE);
changed(Property::PLAYER_DEBUG_LOG);
changed(Property::HISTORY);
changed(Property::SHOW_EXPERIMENTAL_AUDIO_PROCESSORS);