# HG changeset patch # User Paper # Date 1704805536 18000 # Node ID d030b30526d58e54c88bf5a8c0c436ffc4ddd5a5 # Parent c4f03f83b2526ca23732367bad2d8f558e607324 config: remove unused username parameter from anilist auth diff -r c4f03f83b252 -r d030b30526d5 include/core/config.h --- a/include/core/config.h Mon Jan 08 21:30:18 2024 -0500 +++ b/include/core/config.h Tue Jan 09 08:05:36 2024 -0500 @@ -35,12 +35,9 @@ bool highlighted_anime_above_others; } anime_list; - /* these should preferably be in an - "auth" struct... */ struct { struct { std::string auth_token; - std::string username; int user_id; } anilist; } auth; diff -r c4f03f83b252 -r d030b30526d5 src/core/config.cc --- a/src/core/config.cc Mon Jan 08 21:30:18 2024 -0500 +++ b/src/core/config.cc Tue Jan 09 08:05:36 2024 -0500 @@ -33,7 +33,7 @@ int Config::Load() { std::filesystem::path cfg_path = Filesystem::GetConfigPath(); - mINI::INIFile file(cfg_path.string()); + mINI::INIFile file(cfg_path.u8string()); mINI::INIStructure ini; file.read(ini); diff -r c4f03f83b252 -r d030b30526d5 src/gui/dialog/settings/library.cc --- a/src/gui/dialog/settings/library.cc Mon Jan 08 21:30:18 2024 -0500 +++ b/src/gui/dialog/settings/library.cc Tue Jan 09 08:05:36 2024 -0500 @@ -49,7 +49,7 @@ } void DroppableListWidget::dropEvent(QDropEvent* event) { - const QMimeData *mime_data = event->mimeData(); + const QMimeData* mime_data = event->mimeData(); if (!mime_data->hasUrls()) return; diff -r c4f03f83b252 -r d030b30526d5 src/gui/window.cc --- a/src/gui/window.cc Mon Jan 08 21:30:18 2024 -0500 +++ b/src/gui/window.cc Tue Jan 09 08:05:36 2024 -0500 @@ -175,9 +175,11 @@ QDesktopServices::openUrl(QUrl::fromLocalFile(folder)); }); if (i < 9) - action->setShortcut(QKeySequence(Qt::ALT | (Qt::Key_1 + i++))); + action->setShortcut(QKeySequence(Qt::ALT | static_cast(Qt::Key_1 + i))); else if (i == 9) action->setShortcut(QKeySequence(Qt::ALT | Qt::Key_0)); + /* don't bother with a shortcut in case of more... */ + i++; } folder_menu->addSeparator(); diff -r c4f03f83b252 -r d030b30526d5 src/library/library.cc --- a/src/library/library.cc Mon Jan 08 21:30:18 2024 -0500 +++ b/src/library/library.cc Tue Jan 09 08:05:36 2024 -0500 @@ -19,13 +19,13 @@ void SearchLibraryFolders() { library.clear(); - for (const auto& spath : session.config.library.paths) { - const std::filesystem::path path(spath); - for (const auto& entry : std::filesystem::recursive_directory_iterator(path)) { - if (!std::filesystem::is_regular_file(entry.path())) + for (const auto& folder : session.config.library.paths) { + for (const auto& entry : std::filesystem::recursive_directory_iterator(folder)) { + const std::filesystem::path path = entry.path(); + if (!std::filesystem::is_regular_file(path)) continue; - const std::string basename = entry.path().filename().string(); + const std::string basename = path.filename().u8string(); anitomy::Anitomy anitomy; anitomy.Parse(Strings::ToWstring(basename)); @@ -41,7 +41,7 @@ const int episode = Strings::ToInt(Strings::ToUtf8String(elements.get(anitomy::kElementEpisodeNumber))); // we have an ID now! - library[id][episode] = entry.path(); + library[id][episode] = path.u8string(); } } } diff -r c4f03f83b252 -r d030b30526d5 src/services/anilist.cc --- a/src/services/anilist.cc Mon Jan 08 21:30:18 2024 -0500 +++ b/src/services/anilist.cc Tue Jan 09 08:05:36 2024 -0500 @@ -30,9 +30,6 @@ class Account { public: - std::string Username() const { return session.config.auth.anilist.username; } - void SetUsername(std::string const& username) { session.config.auth.anilist.username = username; } - int UserId() const { return session.config.auth.anilist.user_id; } void SetUserId(const int id) { session.config.auth.anilist.user_id = id; } @@ -300,7 +297,6 @@ } int ParseUser(const nlohmann::json& json) { - account.SetUsername(JSON::GetString(json, "/name"_json_pointer, "")); account.SetUserId(JSON::GetNumber(json, "/id"_json_pointer, 0)); return account.UserId(); } diff -r c4f03f83b252 -r d030b30526d5 src/track/media.cc --- a/src/track/media.cc Mon Jan 08 21:30:18 2024 -0500 +++ b/src/track/media.cc Tue Jan 09 08:05:36 2024 -0500 @@ -45,7 +45,7 @@ switch (info.type) { case animia::MediaInfoType::File: case animia::MediaInfoType::Title: - vec.push_back(std::filesystem::path(info.value).filename().string()); + vec.push_back(std::filesystem::path(info.value).filename().u8string()); success |= true; default: break;