diff src/gui/pages/now_playing.cpp @ 79:c489dd4434af

*: what did I do again? I really forgot what I did here :)
author Paper <mrpapersonic@gmail.com>
date Thu, 12 Oct 2023 11:31:39 -0400
parents 27a19dd6cba1
children 825506f0e221
line wrap: on
line diff
--- a/src/gui/pages/now_playing.cpp	Wed Oct 11 12:16:15 2023 -0400
+++ b/src/gui/pages/now_playing.cpp	Thu Oct 12 11:31:39 2023 -0400
@@ -21,11 +21,12 @@
 
 	public:
 		Playing(QWidget* parent = nullptr);
-		void SetPlayingAnime(int id);
+		void SetPlayingAnime(int id, int episode);
 		int GetPlayingAnime();
 
 	private:
 		int _id = 0;
+		int _episode = 0;
 		std::unique_ptr<AnimeInfoWidget> info = nullptr;
 };
 
@@ -46,7 +47,9 @@
 	return _id;
 }
 
-void Playing::SetPlayingAnime(int id) {
+void Playing::SetPlayingAnime(int id, int episodes) {
+	if (id == _id)
+		return;
 	if (info.get())
 		layout()->removeWidget(info.get());
 	if (Anime::db.items.find(id) != Anime::db.items.end()) {
@@ -87,8 +90,8 @@
 	return reinterpret_cast<NowPlayingPages::Playing*>(stack->widget(1))->GetPlayingAnime();
 }
 
-void NowPlayingPage::SetPlaying(int id) {
-	reinterpret_cast<NowPlayingPages::Playing*>(stack->widget(1))->SetPlayingAnime(id);
+void NowPlayingPage::SetPlaying(int id, int episodes) {
+	reinterpret_cast<NowPlayingPages::Playing*>(stack->widget(1))->SetPlayingAnime(id, episodes);
 	stack->setCurrentIndex(1);
 }