comparison src/gui/window.cc @ 83:d02fdf1d6708

*: huuuge update 1. make the now playing page function correctly 2. de-constructorfy many of our custom widgets, allowing them to be changed on-the-fly from the Now Playing page 3. ... :)
author Paper <mrpapersonic@gmail.com>
date Tue, 24 Oct 2023 22:01:02 -0400
parents 8b65c417c225
children b315f3759c56
comparison
equal deleted inserted replaced
82:8b65c417c225 83:d02fdf1d6708
96 NowPlayingPage* page = reinterpret_cast<NowPlayingPage*>(stack->widget(static_cast<int>(Pages::NOW_PLAYING))); 96 NowPlayingPage* page = reinterpret_cast<NowPlayingPage*>(stack->widget(static_cast<int>(Pages::NOW_PLAYING)));
97 97
98 Filesystem::Path p = Track::Media::GetCurrentPlaying(); 98 Filesystem::Path p = Track::Media::GetCurrentPlaying();
99 std::unordered_map<std::string, std::string> elements = Track::Media::GetFileElements(p); 99 std::unordered_map<std::string, std::string> elements = Track::Media::GetFileElements(p);
100 int id = Anime::db.GetAnimeFromTitle(elements["title"]); 100 int id = Anime::db.GetAnimeFromTitle(elements["title"]);
101 if (id == 0) { 101 if (id <= 0) {
102 page->SetDefault(); 102 page->SetDefault();
103 return; 103 return;
104 } 104 }
105 105
106 page->SetPlaying(id, elements); 106 page->SetPlaying(Anime::db.items[id], elements);
107 }); 107 });
108 timer->start(5000); 108 timer->start(5000);
109 109
110 DarkTheme::SetTheme(session.config.theme); 110 DarkTheme::SetTheme(session.config.theme);
111 } 111 }