From a82fdea1ac84693288ed5656f3ff89ceaaaeea1b Mon Sep 17 00:00:00 2001 From: Morph <39850852+Morph1984@users.noreply.github.com> Date: Sun, 5 Jul 2020 09:37:50 -0400 Subject: registered_cache: Remove previous update/dlc if it exists on install - This checks for and removes old updates or dlc based on title id. If a content meta nca exists within the registered cache, it will attempt to remove all the ncas associated with the content meta before installing a new update/dlc --- src/core/file_sys/registered_cache.h | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'src/core/file_sys/registered_cache.h') diff --git a/src/core/file_sys/registered_cache.h b/src/core/file_sys/registered_cache.h index f339cd17b..8598f0543 100644 --- a/src/core/file_sys/registered_cache.h +++ b/src/core/file_sys/registered_cache.h @@ -34,6 +34,7 @@ using VfsCopyFunction = std::function title_type = {}, std::optional record_type = {}, std::optional title_id = {}) const override; + // Removes an existing entry based on title id + bool RemoveExistingEntry(const u64 title_id); + // Raw copies all the ncas from the xci/nsp to the csache. Does some quick checks to make sure // there is a meta NCA and all of them are accessible. InstallResult InstallEntry(const XCI& xci, bool overwrite_if_exists = false, -- cgit v1.2.3 From 8794e623d99d6179ab15f76ddf473002d112fc3a Mon Sep 17 00:00:00 2001 From: Morph <39850852+Morph1984@users.noreply.github.com> Date: Sun, 5 Jul 2020 10:38:34 -0400 Subject: Remove global system instance and address feedback --- src/core/file_sys/registered_cache.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/core/file_sys/registered_cache.h') diff --git a/src/core/file_sys/registered_cache.h b/src/core/file_sys/registered_cache.h index 8598f0543..3459c695b 100644 --- a/src/core/file_sys/registered_cache.h +++ b/src/core/file_sys/registered_cache.h @@ -156,7 +156,7 @@ public: std::optional title_id = {}) const override; // Removes an existing entry based on title id - bool RemoveExistingEntry(const u64 title_id); + bool RemoveExistingEntry(u64 title_id); // Raw copies all the ncas from the xci/nsp to the csache. Does some quick checks to make sure // there is a meta NCA and all of them are accessible. -- cgit v1.2.3 From 0ca7b8269af70ed80c60148fc966343f85034222 Mon Sep 17 00:00:00 2001 From: Morph <39850852+Morph1984@users.noreply.github.com> Date: Sun, 5 Jul 2020 09:45:07 -0400 Subject: clang format --- src/core/file_sys/registered_cache.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/core/file_sys/registered_cache.h') diff --git a/src/core/file_sys/registered_cache.h b/src/core/file_sys/registered_cache.h index 3459c695b..29cf0d40c 100644 --- a/src/core/file_sys/registered_cache.h +++ b/src/core/file_sys/registered_cache.h @@ -133,9 +133,9 @@ public: // Parsing function defines the conversion from raw file to NCA. If there are other steps // besides creating the NCA from the file (e.g. NAX0 on SD Card), that should go in a custom // parsing function. - explicit RegisteredCache( - VirtualDir dir, ContentProviderParsingFunction parsing_function = - [](const VirtualFile& file, const NcaID& id) { return file; }); + explicit RegisteredCache(VirtualDir dir, + ContentProviderParsingFunction parsing_function = + [](const VirtualFile& file, const NcaID& id) { return file; }); ~RegisteredCache() override; void Refresh() override; -- cgit v1.2.3