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-03 21:37:04 +0100
commit9b841fddd3aa4a1117b03299bce964c5e4b205d9 (patch)
tree61022295269b8e55a5fbefabb88183dd96d1afcf /src/lib/config.cc
parent8a4591d1f77e2de6e92385e0ab0b3efc714feeb9 (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 267831341..60859e739 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"
@@ -191,7 +192,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();
@@ -621,7 +622,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")) {
@@ -1107,10 +1116,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());
@@ -1685,7 +1692,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);