Fix not being able to get the title of the playing audio file, due to using an obsolete way to get it in the playback class

This commit is contained in:
Zachary Hall 2025-01-15 08:54:09 -08:00
parent 16995b71b3
commit 84b324e01c

View file

@ -468,16 +468,14 @@ PlaybackInstance::PlaybackInstance() {
}
std::optional<std::string> PlaybackInstance::get_current_file() {
current_file_mutex.lock();
std::optional<std::string> output = current_file;
current_file_mutex.unlock();
return output;
if (process == nullptr) return {};
if (!process->process_running()) return {};
return process->get_file_path();
}
std::optional<std::string> PlaybackInstance::get_current_title() {
current_file_mutex.lock();
std::optional<std::string> output = current_title;
current_file_mutex.unlock();
return output;
if (process == nullptr) return {};
if (!process->process_running()) return {};
return process->get_title();
}
PlaybackInstance::~PlaybackInstance() {
Stop();