Skip to content

Metadata Utilities: Merge Rules

Alexander Heidn edited this page Mar 16, 2024 · 6 revisions

The main purpose of Metadata Utilities is to streamline your metadata like categories, features, genres, series and tags. The different metadata providers unfortunately often have very different opinions what a feature or tag is or how to call it. That's where the merge rules come in. With these you can define which metadata items of the types mentioned above should be merged into one and how that one should be called.

How to add and edit merge rules

Metadata Editor window

Let's say you want to combine the PCGamingWiki features "Partial Controller Support" and "Full Controller Support" as well as the Steam tag "Hardware/Input: Controller" into one feature called "Controller Support". To make a merge rule out of that, you have two options.

1. Metadata Editor

Open the Metadata Editor window, search for "Controller" and select all the results in the metadata grid. Then click on "Merge", select which one of those should be the target they are merged into and tick the checkbox to add a merge rule. After clicking OK the items will be merged together and the merge rule will appear in the addon settings in the Merging tab.

2. Merge Rule Editor

Go into the addon settings and click the "Merging" tab. Then click the Plus-button below the left grid. That opens the Merge Rule Editor. This window is very similar to the Metadata Editor. You can search and filter the metadata you want and then select all you want to merge by ticking their checkbox.

Metadata Editor window

On the top left are the fields for type and name the merged item will then have. To copy the value of one of the items you want to merge into it, click the small buttom to the left of that item.

You also can add new items to merge by clicking Add new item, so you don't need to have the item in your database already. If you only want to see the items you already selected, tick the "Only selected" checkbox on the left.

Clicking on Save then saves the merge rule and it will appear in the grid in the settings. There you can also edit existing merge rules (opens the Merge Rule Editor with the items preselected) and delete the ones you don't need anymore.

In the addon settings there's also a plus-button below the grid on the right to quickly add more items to merge to the selected rule.

How to execute merge rules

If you want to automatically execute your setup rules, when the metadata of a game changes, you need to tick the checkbox "Automatically execute merge rule on metadata update" in the addon settings under the "Merging" tab. There's also a button that allows you to automatically save manual merges done in the Metadata Editor as new merge rules, if you don't want to tick the checkbox in the merge dialog every time.

You can also manually execute merge rules by selecting one or more games in Playnite and then using the options under Metadata Utilities in the context menu. There's an entry "Merge metadata" to simply apply all merge rules to the selected games, and a sub menu "Merge rules" to select a specific rule you want to execute.

Other things to know

Renaming

If you rename metadata items and have Merge Rules that merge items into that item you just renamed, by default the rule still targets the old name. That means if you for example rename a feature "Controller Support" to just "Controller" and you have a merge rule that merges items into the feature called "Controller Support", it will still use that old name. To also rename your merge rules when renaming the corresponding item, you need to tick the checkbox "Automatically rename merge rule target when the corresponding original item is renamed." under the "Merging" tab of the addon settings.

That affects all means of renaming metadata items (using the Library Manager window, the addon's Metadata Editor or other addons). This option however only renames the target of the merge rule, not the items you want to merge. That way you can clean up your metadata names and still merge the ones that come in with the wrong old names via new metadata imports.

Keep it simple!

You should try to keep your merge rules simple. The addon isn't designed to recursively execute nerge rules (it will only apply them alphabetically once each run). You can add items to merge into a merge rule that themselves are already the target of another rule, but that will probably lead to undesired results.

Merging merge rules

If you want to merge two merge rules into one, you can do that by simply editing one of them and changing the target name/type to the target of the other rule. The addon will then ask you, if you want to merge both rules, replace the other one or cancel the edit when you click save. That also applies, if you add a new rule and accidentally (or intenionally) use the same target as one of the already existing rules.