Skip to content

Commit

Permalink
Merge branch 'erengy:develop' into pr/gh_actions
Browse files Browse the repository at this point in the history
  • Loading branch information
hdk5 authored Nov 20, 2021
2 parents aeef51f + 3d37385 commit ff27413
Show file tree
Hide file tree
Showing 12 changed files with 23 additions and 21 deletions.
2 changes: 1 addition & 1 deletion deps/src/curl
Submodule curl updated 682 files
2 changes: 1 addition & 1 deletion deps/src/json
Submodule json updated 81 files
+1 −1 .github/ISSUE_TEMPLATE/Bug_report.md
+1 −1 CITATION.cff
+1 −1 CMakeLists.txt
+28 −12 ChangeLog.md
+2 −2 README.md
+1 −1 doc/Doxyfile
+1 −1 doc/examples/README.link
+2 −2 doc/examples/meta.output
+1 −1 doc/index.md
+ doc/json.gif
+17 −1 include/nlohmann/detail/conversions/from_json.hpp
+13 −0 include/nlohmann/detail/conversions/to_json.hpp
+11 −28 include/nlohmann/detail/meta/type_traits.hpp
+4 −3 include/nlohmann/detail/output/serializer.hpp
+4 −4 include/nlohmann/json.hpp
+1 −1 meson.build
+50 −36 single_include/nlohmann/json.hpp
+1 −1 test/src/fuzzer-driver_afl.cpp
+1 −1 test/src/fuzzer-parse_bson.cpp
+1 −1 test/src/fuzzer-parse_cbor.cpp
+1 −1 test/src/fuzzer-parse_json.cpp
+1 −1 test/src/fuzzer-parse_msgpack.cpp
+1 −1 test/src/fuzzer-parse_ubjson.cpp
+1 −1 test/src/unit-algorithms.cpp
+1 −1 test/src/unit-allocator.cpp
+1 −1 test/src/unit-alt-string.cpp
+1 −1 test/src/unit-assert_macro.cpp
+1 −1 test/src/unit-bson.cpp
+1 −1 test/src/unit-byte_container_with_subtype.cpp
+1 −1 test/src/unit-capacity.cpp
+1 −1 test/src/unit-cbor.cpp
+1 −1 test/src/unit-class_const_iterator.cpp
+1 −1 test/src/unit-class_iterator.cpp
+1 −1 test/src/unit-class_lexer.cpp
+1 −1 test/src/unit-class_parser.cpp
+1 −1 test/src/unit-comparison.cpp
+1 −1 test/src/unit-concepts.cpp
+1 −1 test/src/unit-constructor1.cpp
+1 −1 test/src/unit-constructor2.cpp
+1 −1 test/src/unit-convenience.cpp
+1 −1 test/src/unit-conversions.cpp
+1 −1 test/src/unit-deserialization.cpp
+1 −1 test/src/unit-diagnostics.cpp
+1 −1 test/src/unit-disabled_exceptions.cpp
+1 −1 test/src/unit-element_access1.cpp
+1 −1 test/src/unit-element_access2.cpp
+1 −1 test/src/unit-hash.cpp
+1 −1 test/src/unit-inspection.cpp
+1 −1 test/src/unit-items.cpp
+1 −1 test/src/unit-iterators1.cpp
+1 −1 test/src/unit-iterators2.cpp
+1 −1 test/src/unit-json_patch.cpp
+1 −1 test/src/unit-json_pointer.cpp
+1 −1 test/src/unit-large_json.cpp
+1 −1 test/src/unit-merge_patch.cpp
+3 −3 test/src/unit-meta.cpp
+1 −1 test/src/unit-modifiers.cpp
+1 −1 test/src/unit-msgpack.cpp
+1 −1 test/src/unit-noexcept.cpp
+1 −1 test/src/unit-ordered_json.cpp
+1 −1 test/src/unit-ordered_map.cpp
+1 −1 test/src/unit-pointer_access.cpp
+1 −1 test/src/unit-readme.cpp
+1 −1 test/src/unit-reference_access.cpp
+1 −1 test/src/unit-regression1.cpp
+113 −62 test/src/unit-regression2.cpp
+1 −1 test/src/unit-serialization.cpp
+1 −1 test/src/unit-testsuites.cpp
+1 −1 test/src/unit-to_chars.cpp
+1 −1 test/src/unit-ubjson.cpp
+1 −1 test/src/unit-udt.cpp
+1 −1 test/src/unit-udt_macro.cpp
+1 −1 test/src/unit-unicode1.cpp
+1 −1 test/src/unit-unicode2.cpp
+1 −1 test/src/unit-unicode3.cpp
+1 −1 test/src/unit-unicode4.cpp
+1 −1 test/src/unit-unicode5.cpp
+1 −1 test/src/unit-user_defined_input.cpp
+1 −1 test/src/unit-wstring.cpp
+1 −1 test/src/unit.cpp
+1 −1 wsjcpp.yml
File renamed without changes.
12 changes: 6 additions & 6 deletions project/vs2019/Taiga.vcxproj → project/vs2022/Taiga.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -37,40 +37,40 @@
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v142</PlatformToolset>
<PlatformToolset>v143</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v142</PlatformToolset>
<PlatformToolset>v143</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v142</PlatformToolset>
<PlatformToolset>v143</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v142</PlatformToolset>
<PlatformToolset>v143</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v142</PlatformToolset>
<PlatformToolset>v143</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v142</PlatformToolset>
<PlatformToolset>v143</PlatformToolset>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
Expand Down
File renamed without changes.
1 change: 1 addition & 0 deletions src/media/anime.h
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ constexpr std::array<MyStatus, 5> kMyStatuses{
MyStatus::PlanToWatch,
};

constexpr int kMaxEpisodeCount = 1900;
constexpr int kUnknownEpisodeCount = -1;
constexpr int kUnknownEpisodeLength = -1;
constexpr double kUnknownScore = 0.0;
Expand Down
5 changes: 3 additions & 2 deletions src/media/anime_item.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
** along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

#include <algorithm>
#include <assert.h>

#include "media/anime_item.h"
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion src/media/anime_util.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
14 changes: 7 additions & 7 deletions src/media/library/list.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
Expand All @@ -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;
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/taiga/announce.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/ui/dlg/dlg_about.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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"}}}, "
Expand Down
2 changes: 1 addition & 1 deletion src/ui/ui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ bool OnLibraryEntriesEditDelete(const std::vector<int> ids) {

int OnLibraryEntriesEditEpisode(const std::vector<int> ids) {
std::set<int> 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)
Expand Down

0 comments on commit ff27413

Please sign in to comment.