Mercurial > minori
comparison src/gui/window.cpp @ 80:825506f0e221
[UNFINISHED]: stuff
| author | Paper <mrpapersonic@gmail.com> |
|---|---|
| date | Fri, 13 Oct 2023 13:15:19 -0400 |
| parents | c489dd4434af |
| children |
comparison
equal
deleted
inserted
replaced
| 79:c489dd4434af | 80:825506f0e221 |
|---|---|
| 94 QTimer* timer = new QTimer(this); | 94 QTimer* timer = new QTimer(this); |
| 95 connect(timer, &QTimer::timeout, this, [this] { | 95 connect(timer, &QTimer::timeout, this, [this] { |
| 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::string title = Track::Media::GetFileTitle(p); | 99 std::unordered_map<std::string, std::string> elements = Track::Media::GetFileElements(p); |
| 100 int id = Anime::db.GetAnimeFromTitle(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, -1); | 106 page->SetPlaying(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 } |
