diff --git a/src/Player.h b/src/Player.h index 3a3927cb1..4b039f4c6 100644 --- a/src/Player.h +++ b/src/Player.h @@ -24,9 +24,10 @@ class Player : public httpserver::http_resource { void Init(); + // manualPriority: Lower = higher importance. Default allows scheduled playlists to take priority. int StartPlaylist(const std::string& name, const int repeat = -1, const int startPosition = -1, const int endPosition = -1, - const int manualPriority = -1); + const int manualPriority = 10000); int StartScheduledPlaylist(const std::string& name, const int position, const int repeat, const int scheduleEntry, const int scheduledPriority, const time_t sTime, const time_t eTime, const int method); diff --git a/src/Scheduler.cpp b/src/Scheduler.cpp index d684d886b..0228012d4 100644 --- a/src/Scheduler.cpp +++ b/src/Scheduler.cpp @@ -522,13 +522,19 @@ bool Scheduler::doScheduledPlaylist(const std::time_t& now, const std::time_t& i if (!Player::INSTANCE.WasScheduled()) { // Manually started playlist is running, check priority + // Lower priority number = higher importance + // Manual playlists default to priority 10000, scheduled use entry index (0-99 typical) if (Player::INSTANCE.GetPriority() > item->priority) { - // Scheduled playlist has higher priority, stop the manual one + // Scheduled playlist has higher priority (lower number), stop the manual one + LogDebug(VB_SCHEDULE, "Stopping manual playlist (priority %d) for scheduled item (priority %d)\n", + Player::INSTANCE.GetPriority(), item->priority); while (Player::INSTANCE.GetStatus() != FPP_STATUS_IDLE) { Player::INSTANCE.StopNow(1); } } else { // Manual playlist has higher or equal priority, let it continue + LogDebug(VB_SCHEDULE, "Manual playlist (priority %d) blocking scheduled item (priority %d)\n", + Player::INSTANCE.GetPriority(), item->priority); return false; } } else if (Player::INSTANCE.GetPriority() > item->priority) {