162 Commits
Author SHA1 Message Date
Oliver Hamlet 3cee54de04 Add a Message constructor that takes a SimpleMessage 2021-09-23 13:31:35 +01:00
Oliver Hamlet e5a229e09f Move file versioning functions out of DatabaseInterface
They don't need to be member functions, and needing a pointer to an
instance of that interface is awkward.

The function names have also changed to reflect that they're not
specific to the masterlists.
2021-09-23 13:31:34 +01:00
Oliver Hamlet 5ce0df0f03 Add support for masterlist prelude files
This allows common metadata to be shared across masterlists in a
'prelude' YAML file that is then injected into a masterlist when it is
loaded. Masterlist metadata can then reference anchors within the
prelude to make use of those common metadata.

The prelude file will be version controlled in a separate Git
repository, so the masterlist update functions also apply to managing
its versioning.
2021-09-23 13:31:34 +01:00
Oliver Hamlet 08acdb9c65 Rename MasterlistInfo to FileRevision
To reflect that it will soon be used to provide info for other
version-controlled files. Also rename its revision_id and
revision_date fields to remove the revision_ prefixes.
2021-09-23 13:30:39 +01:00
Oliver Hamlet be30bc500f Remove masterlist update loading and rollback
LOOT's ability to roll back to a working masterlist version hasn't been
exercised in years, as our CI testing has gotten better at catching
issues before they reach users.

Coupling updating a masterlist with loading it also complicates the
introduction of a common prelude, so given the very low usefulness of
the functionality it's best to drop it entirely .
2021-08-05 19:13:37 +01:00
Oliver Hamlet 4faab46069 Make MessageContent::Choose() return an optional
And propagate this through the File, Message and PluginCleaningData APIs
that call it.
2021-05-22 22:15:32 +01:00
Oliver Hamlet a9a71998f1 Rename the 'info' property in cleaning data objects to 'detail'
To be consistent with the new property in File objects, as they share
the same type and sematics.
2021-05-22 19:26:29 +01:00
Oliver Hamlet fc22d3d7a4 Add a "detail" property to File objects
This property can be used to provide detail about a requirement or
incompatibility that can be displayed in the error message displayed
for the file (if one is displayed).
2021-05-22 19:26:29 +01:00
Oliver Hamlet 4f75be3d81 Make PluginInterface::GetHeaderVersion() return an optional
While the value could actually be NaN, that's also what esplugin uses to
signal that the version could not be found, and either way a NaN value
is useless.
2021-05-08 21:46:25 +01:00
Oliver Hamlet 97b8db9191 Fix incorrect doc comments on MasterlistInfo 2021-05-08 21:35:02 +01:00
Oliver Hamlet 48d5c87d96 Remove deprecated API functions 2021-05-08 21:14:10 +01:00
Oliver Hamlet 897a303ec7 Deprecate PluginInterface::IsLightMaster() and PluginInterface::IsValidAsLightMaster()
In favour of IsLightPlugin() and IsValidAsLightPlugin() respectively.
The new functions are identical to the old besides their names, which
now more clearly indicate that plugins can be light without being
masters.
2021-05-06 21:03:02 +01:00
Oliver Hamlet cd978bb215 Compare language codes in MessageContent::Choose()
If there is no exact match, compare language codes so that a more
generic match is preferred over just returning the English content.

This means that if a locale code is given, Choose() will also look for
the locale's language code (but will not match another locale with the
same language code), and if a language code is given, Choose() will also
look for a locale with that language code.
2021-03-28 22:31:14 +01:00
Oliver Hamlet 36d90ee72b Fix File::GetDisplayName() not escaping special chars
When display_ is an empty string, GetDisplayName() returns name_, but
name_'s value might contain Markdown special characters, and
GetDisplayName() is supposed to return a Markdown string, though this
was poorly documented.
2020-07-27 22:18:54 +01:00
Oliver Hamlet 3a8875b307 Fix doc comments for File and Group 2020-07-12 10:00:42 +01:00
Oliver Hamlet c74f2f4978 Remove PluginMetadata::operator== and != for PluginMetadata
Unlike the other metadata classes, they were only comparing plugin names
not full object equality. Checking full object equality isn't very
useful, so instead the operators have been replaced by a new
NameMatches() method that takes a non-regex plugin name string.
2020-07-11 19:14:06 +01:00
Oliver Hamlet c9ce0f96d0 Remove PluginMetadata::operator== and != for std::string 2020-07-11 19:14:06 +01:00
Oliver Hamlet 062ab24139 Make File::GetName() return a Filename 2020-07-11 19:14:05 +01:00
Oliver Hamlet 15d98c9c20 Add a new Filename class to the API
It'll be used to represent filenames that get compared
case-insensitively.
2020-07-11 19:14:05 +01:00
Oliver Hamlet 14bdbe1fdf Make PluginMetadata::GetLocations() return a std::vector
The collection is only ever iterated over, and the uniqueness and
ordering don't matter.
2020-07-11 19:14:05 +01:00
Oliver Hamlet d5881047cc Make PluginMetadata::GetCleanInfo() return a std::vector
The collection is only ever iterated over, and the uniqueness and
ordering don't matter.
2020-07-11 19:14:04 +01:00
Oliver Hamlet 88a1c6f6d1 Make PluginMetadata::GetDirtyInfo() return a std::vector
The collection is only ever iterated over, and the uniqueness and
ordering don't matter.
2020-07-11 19:14:04 +01:00
Oliver Hamlet eeff7a9283 Make PluginMetadata::GetTags() return a std::vector
The collection is only ever iterated over, and the uniqueness and
ordering don't matter.
2020-07-11 19:14:04 +01:00
Oliver Hamlet 8dbbb55ecc Make PluginMetadata::GetIncompatibilities() return a std::vector
The collection is only ever iterated over, and the uniqueness and
ordering don't matter.
2020-07-11 19:14:04 +01:00
Oliver Hamlet 2bfc38358b Make PluginMetadata::GetRequirements() return a std::vector
The collection is only ever iterated over, and the uniqueness and
ordering don't matter.
2020-07-11 19:14:03 +01:00