diff options
Diffstat (limited to 'src/main/app_console.cpp')
| -rw-r--r-- | src/main/app_console.cpp | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/src/main/app_console.cpp b/src/main/app_console.cpp index fc2a4fe5..00bfa993 100644 --- a/src/main/app_console.cpp +++ b/src/main/app_console.cpp @@ -176,10 +176,18 @@ int CmdDbSongs(int argc, char** argv) { return 1; } - database::DbResult<database::Song> res = + database::Result<database::Song> res = sInstance->database_->GetSongs(10).get(); - for (database::Song s : res.values()) { - std::cout << s.title << std::endl; + while (true) { + std::unique_ptr<std::vector<database::Song>> r = res.values(); + for (database::Song s : *r) { + std::cout << s.title << std::endl; + } + if (res.HasMore()) { + res = sInstance->database_->GetMoreSongs(10, res.continuation()).get(); + } else { + break; + } } return 0; |
