Commit Graph

149 Commits

Author SHA1 Message Date
cd71ec0edd Remove ILive<> interface (and use abstract Live<> instead) 2022-01-26 13:38:56 +09:00
778d2a71b4 Remove Task from the inner-most Import method in RealmArchiveModelImporter
One of my pending work items for post-realm merge.

The lowest-level import task is no longer asynchronous, as we don't want
it to span multiple threads to allow easier interaction with realm.
Removing the `Task` spec simplifies a heap of usages.

Individual usages should decide whether they want to run the import
asynchronously, by either using an alternative override or spooling up a
thread themselves.
2022-01-25 15:30:29 +09:00
d7342880f5 Update remaining cases of clashes with realm.Write and realm.RegisterForNotifications 2022-01-25 13:09:48 +09:00
e23b10e6a5 Update remaining cases of clashing variable name in realm.Run(realm.. 2022-01-25 13:04:05 +09:00
6eb2c28e41 Rename RealmContextFactory to RealmAccess 2022-01-24 20:38:07 +09:00
114c9e8c1f Update all usages of CreateContext to use either Run or Write 2022-01-21 17:27:08 +09:00
a5d2047f05 Fix various cases of creating realm contexts from update thread when not necessary 2022-01-21 01:44:56 +09:00
00177a3ae1 Update usages to new naming 2022-01-06 22:54:43 +09:00
73b40e6833 Replace usage of .Result with .WaitSafelyForResult 2022-01-04 11:51:41 +09:00
441b7baa93 Provide a realm factory to usages of ToLive/RealmLive 2021-12-14 14:26:34 +09:00
0e82e9355b Ensure skin is saved immediately after becoming mutable
Without doing this, the JSON content is not written to the file. A user
assumption is that as soon as a skin shows up in the skin list as
exportable, it should export correctly, so it makes sense that it should
be in a sane state even if the user has not made any changes in the skin
editor yet.

Going forward, we might move more of the json serialisation logic out,
and run for consistency as part of the import process. This seems like
the simplest way to guarantee things for now, though.
2021-12-02 17:42:17 +09:00
0a14acfd83 Fix incorrect conditional on export/mutate feasability of skin 2021-12-02 13:41:58 +09:00
0d18c83d75 Simplify deletion by adding always present conditionals to Delete method 2021-11-29 18:28:25 +09:00
f6a3709060 Store default skins to database 2021-11-29 18:28:25 +09:00
c629a7a36f Fix random selection and avoid using legacy events for handling skin import/deletion 2021-11-29 18:28:25 +09:00
29d074bdb8 Implement missing behaviours required for skin file operations via RealmArchiveModelManager 2021-11-29 18:28:25 +09:00
23146d59d1 Use ILive for current skin 2021-11-29 18:28:25 +09:00
94b10492be Update legacy SkinManager to match new interface 2021-11-29 18:20:07 +09:00
cc1b91e4bd Split out legacy model export logic into LegacyModelExporter classes 2021-11-25 16:41:12 +09:00
6cab7b877d Move stable import handling into its own class 2021-11-25 15:36:58 +09:00
2bfc473689 Split out SkinModelManager from SkinManager 2021-11-25 15:14:43 +09:00
59e763467f Move StoragePath implementation to an extension method 2021-11-19 16:08:38 +09:00
1e9211c00b Use explicit type 2021-11-02 15:41:25 +09:00
5d784b2ef8 Perform a consistency check by decoding the newly written skin.ini during ComputeHash
As this has regressed twice now, let's play it safe and bail rather than
stack overflowing. Note that as all the underlying issues that could
trigger this have been fixed, no additional tests have been added. To
test, comment out `SkinManager.cs` line 228-229 to cause a failure. The
new logic will kick in and show a log output message, but all tests will
still (correctly) pass.
2021-11-02 14:11:25 +09:00
2e66ab453d Always write automated changes to skin metadata at the end of the file
Apart from being cleaner (and allowing removal at the point of export,
if that is ever requires), this also gives us a better guarantee that
the metadata is going to take effect.

By writing the `[General]` section ourselves, we avoid any issues that
may be present from a user constructing the file (incorrectly)
themselves, such as multiple `Title:` entries or a malformed `[General]`
marker.

The main goal is to ensure that the name is updated to what we expect it
to be.
2021-11-02 14:11:25 +09:00
6b250955d7 Add missing verbatim string markers 2021-11-01 14:24:38 +09:00
5bfb16efe2 Ignore case when searching for existing skin.ini 2021-11-01 14:24:38 +09:00
26cf5370c3 Remove unused reader parameter 2021-10-24 23:48:46 +09:00
051cc2cd92 Update reference to configuration population process in comment 2021-10-24 12:47:17 +02:00
93482414d6 Remove SkinConfiguration subclasses and allow configuration parsing for all skin types 2021-10-22 14:42:23 +09:00
82d0a6515f Fix incorrect conditional for checking whether import (would fail for default skin) 2021-10-22 14:08:12 +09:00
e5b73f25cd Ensure newly created skin.ini files are set to latest version 2021-10-22 12:56:05 +09:00
a5088cac27 Fix default metadata propagation when no files are present 2021-10-21 13:43:42 +09:00
59b7210efa Revert disallowing imports with no files
While it is logical that we want this, from a testing perspective this is a bit of a nightmare to fix. Let's revisit at a later point in time.
2021-10-21 13:43:42 +09:00
68c01fc204 Fix infinite loop on default skin (it can't have a skin.ini) 2021-10-20 17:56:45 +09:00
9e6e41d7c0 Add migration to reset and repopulate existing skin hashes 2021-10-20 17:56:45 +09:00
602303e947 Add test coverage for skin.ini contents 2021-10-20 17:56:45 +09:00
a95c754fd3 Fix multiple issues and make metadata fallback process more logical 2021-10-20 17:56:45 +09:00
fa542f2547 Include json files in skin hashing
This covers the new layout storage we are doing.
2021-10-20 17:45:06 +09:00
789c715f13 Add skin.ini write support to allow for more correct hashing 2021-10-20 17:45:06 +09:00
a2e61883e3 Initial push to use ILive in import process 2021-09-30 22:55:25 +09:00
a2484692b3 Change brackets to square 2021-08-23 20:37:19 +09:00
7b3f7cc7c1 Change skin import to also include directory names in the skin name where appropriate 2021-08-23 20:24:00 +09:00
58ecee543a Trim redundant default argument value 2021-08-17 23:00:10 +02:00
d66f7cb6b5 Fix tests by allowing retrieval with files where required 2021-08-17 19:21:22 +09:00
4bf22db4ff Attempt to reduce skin lookup overhead where file access is not required 2021-08-17 00:23:30 +09:00
92fcf90768 Merge branch 'master' into import-early-checksum-abort 2021-06-28 19:29:08 +09:00
44f875b802 Bypass optimised existing check in SkinManager (due to custom hashing function) 2021-06-27 16:35:13 +09:00
d1f852d102 Make Populate abstract to avoid unnecessary base call async complexity 2021-06-27 14:29:02 +09:00
71e2815e7e Update and improve code documentation
Co-authored-by: Dean Herbert <pe@ppy.sh>
2021-06-22 12:05:17 +03:00