From 2242e55aa3257d2a29025f895176db615fa7647f Mon Sep 17 00:00:00 2001 From: Eren Okka Date: Fri, 12 Nov 2021 22:56:31 +0300 Subject: [PATCH 1/6] Upgrade to VS2022 --- project/{vs2019 => vs2022}/Taiga.sln | 0 project/{vs2019 => vs2022}/Taiga.vcxproj | 12 ++++++------ project/{vs2019 => vs2022}/Taiga.vcxproj.filters | 0 3 files changed, 6 insertions(+), 6 deletions(-) rename project/{vs2019 => vs2022}/Taiga.sln (100%) rename project/{vs2019 => vs2022}/Taiga.vcxproj (99%) rename project/{vs2019 => vs2022}/Taiga.vcxproj.filters (100%) diff --git a/project/vs2019/Taiga.sln b/project/vs2022/Taiga.sln similarity index 100% rename from project/vs2019/Taiga.sln rename to project/vs2022/Taiga.sln diff --git a/project/vs2019/Taiga.vcxproj b/project/vs2022/Taiga.vcxproj similarity index 99% rename from project/vs2019/Taiga.vcxproj rename to project/vs2022/Taiga.vcxproj index b29580113..12a904539 100644 --- a/project/vs2019/Taiga.vcxproj +++ b/project/vs2022/Taiga.vcxproj @@ -37,40 +37,40 @@ Application true Unicode - v142 + v143 Application true Unicode - v142 + v143 Application true Unicode - v142 + v143 Application false true Unicode - v142 + v143 Application false true Unicode - v142 + v143 Application false true Unicode - v142 + v143 diff --git a/project/vs2019/Taiga.vcxproj.filters b/project/vs2022/Taiga.vcxproj.filters similarity index 100% rename from project/vs2019/Taiga.vcxproj.filters rename to project/vs2022/Taiga.vcxproj.filters From 23116d68540ac4ad5bc2759c6bf91b701a105d81 Mon Sep 17 00:00:00 2001 From: Eren Okka Date: Fri, 19 Nov 2021 13:25:14 +0300 Subject: [PATCH 2/6] Allow sharing private anime manually Complements 514fc2a3523a6253862ca1c4b0ffac11dce26d47. --- src/taiga/announce.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/taiga/announce.cpp b/src/taiga/announce.cpp index 61a80d8b3..adf13e3e9 100644 --- a/src/taiga/announce.cpp +++ b/src/taiga/announce.cpp @@ -55,7 +55,7 @@ void Announcer::Do(int modes, anime::Episode* episode, bool force) { episode = &CurrentEpisode; if (const auto anime_item = anime::db.Find(episode->anime_id)) { - if (anime_item->GetMyPrivate()) { + if (!force && anime_item->GetMyPrivate()) { return; // Avoid sharing private anime } } From 6fac00d42a73cbda677271f7602e064d73fcca68 Mon Sep 17 00:00:00 2001 From: Eren Okka Date: Fri, 19 Nov 2021 14:28:20 +0300 Subject: [PATCH 3/6] Update link for Fugue Icons GitHub repository is no longer available. Linking to search page because home page has "recommended" casino links. Closes #982. --- src/ui/dlg/dlg_about.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ui/dlg/dlg_about.cpp b/src/ui/dlg/dlg_about.cpp index 1e432ea92..9316fa7de 100644 --- a/src/ui/dlg/dlg_about.cpp +++ b/src/ui/dlg/dlg_about.cpp @@ -130,7 +130,7 @@ BOOL AboutDialog::OnInitDialog() { L"{\\field{\\*\\fldinst{HYPERLINK \"https://github.com/HowardHinnant/date\"}}{\\fldrslt{date " + GetLibraryVersion(kDate) + L"}}}, " L"{\\field{\\*\\fldinst{HYPERLINK \"https://github.com/discordapp/discord-rpc\"}}{\\fldrslt{Discord RPC " + GetLibraryVersion(kDiscordRpc) + L"}}}, " L"{\\field{\\*\\fldinst{HYPERLINK \"https://github.com/fmtlib/fmt\"}}{\\fldrslt{fmt " + GetLibraryVersion(kFmt) + L"}}}, " - L"{\\field{\\*\\fldinst{HYPERLINK \"https://github.com/yusukekamiyamane/fugue-icons\"}}{\\fldrslt{Fugue Icons 3.4.5}}}, " + L"{\\field{\\*\\fldinst{HYPERLINK \"https://p.yusukekamiyamane.com/icons/search/fugue/\"}}{\\fldrslt{Fugue Icons 3.4.5}}}, " L"{\\field{\\*\\fldinst{HYPERLINK \"https://github.com/nlohmann/json\"}}{\\fldrslt{JSON for Modern C++ " + GetLibraryVersion(kJson) + L"}}}, " L"{\\field{\\*\\fldinst{HYPERLINK \"https://github.com/curl/curl\"}}{\\fldrslt{libcurl " + GetLibraryVersion(kLibcurl) + L"}}}, " L"{\\field{\\*\\fldinst{HYPERLINK \"https://github.com/zeux/pugixml\"}}{\\fldrslt{pugixml " + GetLibraryVersion(kPugixml) + L"}}}, " From 0c44fc81872b717cbdb9bf1b4bc456df54360c85 Mon Sep 17 00:00:00 2001 From: Eren Okka Date: Fri, 19 Nov 2021 15:51:27 +0300 Subject: [PATCH 4/6] Set maximum episode count Fixes #993. --- src/media/anime.h | 1 + src/media/anime_item.cpp | 5 +++-- src/media/anime_util.cpp | 2 +- src/ui/ui.cpp | 2 +- 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/media/anime.h b/src/media/anime.h index a10124098..7b22b3e81 100644 --- a/src/media/anime.h +++ b/src/media/anime.h @@ -97,6 +97,7 @@ constexpr std::array kMyStatuses{ MyStatus::PlanToWatch, }; +constexpr int kMaxEpisodeCount = 1900; constexpr int kUnknownEpisodeCount = -1; constexpr int kUnknownEpisodeLength = -1; constexpr double kUnknownScore = 0.0; diff --git a/src/media/anime_item.cpp b/src/media/anime_item.cpp index 02467adc0..77cf973f2 100644 --- a/src/media/anime_item.cpp +++ b/src/media/anime_item.cpp @@ -16,6 +16,7 @@ ** along with this program. If not, see . */ +#include #include #include "media/anime_item.h" @@ -160,7 +161,7 @@ void Item::SetType(SeriesType type) { } void Item::SetEpisodeCount(int number) { - series_.episode_count = number; + series_.episode_count = std::clamp(number, 0, kMaxEpisodeCount); // TODO: Call it separately if (number >= 0) @@ -432,7 +433,7 @@ void Item::SetMyId(const std::wstring& id) { void Item::SetMyLastWatchedEpisode(int number) { assert(my_info_.get()); - my_info_->watched_episodes = number; + my_info_->watched_episodes = std::clamp(number, 0, kMaxEpisodeCount); } void Item::SetMyScore(int score) { diff --git a/src/media/anime_util.cpp b/src/media/anime_util.cpp index 7c6a78a8d..c3d73135a 100644 --- a/src/media/anime_util.cpp +++ b/src/media/anime_util.cpp @@ -462,7 +462,7 @@ bool IsAllEpisodesAvailable(const Item& item) { } bool IsValidEpisodeCount(int number) { - return number > 0 && number < 1900; + return number > 0 && number < kMaxEpisodeCount; } bool IsValidEpisodeNumber(int number, int total) { diff --git a/src/ui/ui.cpp b/src/ui/ui.cpp index 1fba2645c..91a9d77d8 100644 --- a/src/ui/ui.cpp +++ b/src/ui/ui.cpp @@ -254,7 +254,7 @@ bool OnLibraryEntriesEditDelete(const std::vector ids) { int OnLibraryEntriesEditEpisode(const std::vector ids) { std::set current; - int number_max = 1900; + int number_max = anime::kMaxEpisodeCount; for (const auto& id : ids) { auto anime_item = anime::db.Find(id); if (!anime_item) From c1a4d634ff0e902d964f335bef92231a56e0f8bb Mon Sep 17 00:00:00 2001 From: Eren Okka Date: Fri, 19 Nov 2021 19:00:41 +0300 Subject: [PATCH 5/6] Fix debug assertion after deleting anime from list The bug was introduced in c0b5b357aa119fd907303a1c94456bfaddce9fe0. Fixes #1035. --- src/media/library/list.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/media/library/list.cpp b/src/media/library/list.cpp index 2e0c6de25..6f139b80c 100644 --- a/src/media/library/list.cpp +++ b/src/media/library/list.cpp @@ -121,15 +121,15 @@ bool Database::SaveList(bool include_database) const { // @TODO: Move to util int Database::GetItemCount(MyStatus status, bool check_history) { - // Get current count int count = 0; - for (const auto& it : items) { - const auto& item = it.second; + + // Get current count + for (const auto& [id, item] : items) { if (item.GetMyRewatching()) { if (status == MyStatus::Watching) ++count; } else { - if (item.GetMyStatus(false) == status) + if (status == item.GetMyStatus(false)) ++count; } } @@ -139,12 +139,12 @@ int Database::GetItemCount(MyStatus status, bool check_history) { for (const auto& queue_item : library::queue.items) { if (queue_item.status || queue_item.mode == library::QueueItemMode::Delete) { - if (status == *queue_item.status) { - count++; + if (queue_item.status && status == *queue_item.status) { + ++count; } else { auto anime_item = Find(queue_item.anime_id); if (anime_item && status == anime_item->GetMyStatus(false)) - count--; + --count; } } } From 3d3738588d60e49748c2b3b98d4859e7e0cd0c82 Mon Sep 17 00:00:00 2001 From: Eren Okka Date: Fri, 19 Nov 2021 19:03:26 +0300 Subject: [PATCH 6/6] Update submodules --- deps/src/curl | 2 +- deps/src/json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/deps/src/curl b/deps/src/curl index c7aef0a94..9e560d11a 160000 --- a/deps/src/curl +++ b/deps/src/curl @@ -1 +1 @@ -Subproject commit c7aef0a945f9b6fb6d3f91716a21dfe2f4ea635f +Subproject commit 9e560d11aad028de74addc0d1edfefa5667884f4 diff --git a/deps/src/json b/deps/src/json index aa0e847e5..fec56a1a1 160000 --- a/deps/src/json +++ b/deps/src/json @@ -1 +1 @@ -Subproject commit aa0e847e5b57a00696bdcb6a834b927231b81613 +Subproject commit fec56a1a16c6e1c1b1f4e116a20e79398282626c