diff --git a/stratosphere/ncm/source/ncm_contentstorage.cpp b/stratosphere/ncm/source/ncm_contentstorage.cpp index 55889a79b..dc1794dac 100644 --- a/stratosphere/ncm/source/ncm_contentstorage.cpp +++ b/stratosphere/ncm/source/ncm_contentstorage.cpp @@ -518,7 +518,7 @@ namespace sts::ncm { } /* Update the cache. */ - eviction_candidate->uuid = content_id; + eviction_candidate->uuid = content_id.uuid; eviction_candidate->rights_id = rights_id; eviction_candidate->key_generation = key_generation; eviction_candidate->last_accessed = rights_id_cache->counter; @@ -705,7 +705,7 @@ namespace sts::ncm { } /* Update the cache. */ - eviction_candidate->uuid = cache_content_id; + eviction_candidate->uuid = cache_content_id.uuid; eviction_candidate->rights_id = rights_id; eviction_candidate->key_generation = key_generation; eviction_candidate->last_accessed = rights_id_cache->counter; diff --git a/stratosphere/ncm/source/ncm_make_path.cpp b/stratosphere/ncm/source/ncm_make_path.cpp index a4a3ed89d..d43d89379 100644 --- a/stratosphere/ncm/source/ncm_make_path.cpp +++ b/stratosphere/ncm/source/ncm_make_path.cpp @@ -45,7 +45,7 @@ namespace sts::ncm::path { void MakeContentPathDualLayered(char* path_out, ContentId content_id, const char* root) { char content_name[FS_MAX_PATH] = {0}; - const u16 hash = Get16BitSha256HashPrefix(content_id); + const u16 hash = Get16BitSha256HashPrefix(content_id.uuid); const u32 hash_lower = (hash >> 4) & 0x3f; const u32 hash_upper = (hash >> 10) & 0x3f; @@ -57,7 +57,7 @@ namespace sts::ncm::path { void MakeContentPath10BitLayered(char* path_out, ContentId content_id, const char* root) { char content_name[FS_MAX_PATH] = {0}; - const u32 hash = (Get16BitSha256HashPrefix(content_id) >> 6) & 0x3FF; + const u32 hash = (Get16BitSha256HashPrefix(content_id.uuid) >> 6) & 0x3FF; GetContentFileName(content_name, content_id); if (snprintf(path_out, FS_MAX_PATH-1, "%s/%08X/%s", root, hash, content_name) < 0) { std::abort(); @@ -66,7 +66,7 @@ namespace sts::ncm::path { void MakeContentPathHashByteLayered(char* path_out, ContentId content_id, const char* root) { char content_name[FS_MAX_PATH] = {0}; - const u32 hash_byte = static_cast(Get8BitSha256HashPrefix(content_id)); + const u32 hash_byte = static_cast(Get8BitSha256HashPrefix(content_id.uuid)); GetContentFileName(content_name, content_id); if (snprintf(path_out, FS_MAX_PATH-1, "%s/%08X/%s", root, hash_byte, content_name) < 0) { std::abort(); @@ -83,7 +83,7 @@ namespace sts::ncm::path { void MakePlaceHolderPathHashByteLayered(char* path_out, PlaceHolderId placeholder_id, const char* root) { char placeholder_name[FS_MAX_PATH] = {0}; - const u32 hash_byte = static_cast(Get8BitSha256HashPrefix(placeholder_id)); + const u32 hash_byte = static_cast(Get8BitSha256HashPrefix(placeholder_id.uuid)); GetPlaceHolderFileName(placeholder_name, placeholder_id); if (snprintf(path_out, FS_MAX_PATH-1, "%s/%08X/%s", root, hash_byte, placeholder_name) < 0) { std::abort(); diff --git a/stratosphere/ncm/source/ncm_types.hpp b/stratosphere/ncm/source/ncm_types.hpp index 01a80091b..8264c4f06 100644 --- a/stratosphere/ncm/source/ncm_types.hpp +++ b/stratosphere/ncm/source/ncm_types.hpp @@ -45,8 +45,12 @@ namespace sts::ncm { struct PlaceHolderId { Uuid uuid; - inline operator Uuid() const { - return this->uuid; + bool operator==(const PlaceHolderId& other) const { + return this->uuid == other.uuid; + } + + bool operator!=(const PlaceHolderId& other) const { + return this->uuid != other.uuid; } bool operator==(const Uuid& other) const { @@ -63,8 +67,12 @@ namespace sts::ncm { struct ContentId { Uuid uuid; - inline operator Uuid() const { - return this->uuid; + bool operator==(const ContentId& other) const { + return this->uuid == other.uuid; + } + + bool operator!=(const ContentId& other) const { + return this->uuid != other.uuid; } bool operator==(const Uuid& other) const {