diff src/gui/window.cc @ 139:478f3b366199

dep/animia: separate lots of things, use base class for OS stuff
author Paper <mrpapersonic@gmail.com>
date Sun, 12 Nov 2023 16:43:07 -0500
parents 28842a8d0c6b
children 6fdf0632c003
line wrap: on
line diff
--- a/src/gui/window.cc	Sun Nov 12 04:53:19 2023 -0500
+++ b/src/gui/window.cc	Sun Nov 12 16:43:07 2023 -0500
@@ -67,11 +67,12 @@
 
 	/* this is very very stinky */
 	connect(timer, &QTimer::timeout, this, [this] {
+		bool success = false;
+
 		NowPlayingPage* page = reinterpret_cast<NowPlayingPage*>(stack->widget(static_cast<int>(Pages::NOW_PLAYING)));
 
 		std::vector<std::string> files;
-		if (!Track::Media::GetCurrentlyPlaying(files))
-			return;
+		Track::Media::GetCurrentlyPlaying(files);
 
 		/* this should really be more intertwined with anitomy */
 		for (const auto& file : files) {
@@ -84,7 +85,12 @@
 			qDebug() << id;
 
 			page->SetPlaying(Anime::db.items[id], elements);
+
+			success = true;
 		}
+
+		if (!success)
+			page->SetDefault();
 	});
 	timer->start(5000);
 }