Overview
Conditional actions allow you to manipulate the metadata of a game based on various conditions. For example, in a game whose genres were previously “Action” and “RPG”, it is possible to remove these and enter “Action-RPG” instead. Or you can set the completion status field of a game to a different value after you have played it for at least one hour. Or tick the “HDR” box if a game has the “HDR support” feature. Or set a “Zombies” tag if the game name or description contains the term “zombie” or “ghoul”. There are almost no limits to the possibilities.
A conditional action can either be executed automatically after updating the metadata of a game or manually by selecting the action in the context menu of the game. This is also useful, for example, to add a range of different metadata to a game with just one click, which you always like to assign together. For example, setting the “Soulslike” genre and simultaneously setting a “difficult” tag.
The Conditional actions tab in the add-on settings is used to manage the actions. Here you can directly set the position and active and manual checkmarks for existing actions. To add new ones or edit the conditions and actions of existing entries, click the Add or Edit button. This opens the “Conditional actions editor”.
Conditional Actions Editor
General Settings
- Name: the name of the conditional action. This is displayed in the context menu for manual execution.
- Type of the conditions: This specifies how the conditions are related to each other, e.g. whether all or at least one of them must be true for the action to be executed.
- Position: Specifies the order in which the actions are processed during automatic execution. This makes it possible to run certain actions first, the result of which then serves as the basis for another action.
- Enabled: Specifies whether the action should be executed automatically after updating the metadata of a game.
- Can be executed manually: Specifies whether the action should be displayed in the context menu of a game for manual execution and can be executed manually. This tick is independent of “Enabled”. Actions that are not enabled can still be executed manually.
- Ignore conditions when executing manually: Does exactly what it says. If this setting is ticked, the action can be executed manually regardless of the conditions.
Conditions
Any number of conditions can be added to a conditional action. These are then related to each other depending on the type selected above, for example, whether all, at least one or none of the conditions must be true for the actions to be executed. A condition is always linked to a field that is then evaluated for each game. Almost all fields that a game can have in Playnite are supported.
Various types of conditions can be added under the conditions grid. Clicking on the buttons opens a menu with the fields supported by this type. Clicking on this then opens either an input dialogue for numbers, dates or string values or, e.g. for genres or tags, a selection box for ticking the respective objects in the field.
The following types of conditions exist:
- “Contains”: The respective field must contain the specified value. For lists such as tags or genres, the value must correspond to an object from the list; for numbers or dates, the value must correspond exactly to that of the game. Strings are evaluated as a regular expression.
- “Does not contain”: The respective field must not contain the specified value. For lists such as tags or genres, the value must not correspond to an object from the list; for numbers or dates, the value must differ from that of the game. Strings are evaluated as regular expressions.
- “Is empty”: The field must be empty. This also applies to checkboxes.
- “Is not empty”: The field must contain a value. For checkboxes, this corresponds to a ticked box.
- “Is greater than”: The value in the field must be greater than the value specified here. Only available for number and date values.
- “Is less than”: The value in the field must be less than the value specified here. Only available for number and date values.
Added conditions can also be removed again using the button with the trash bin.
Actions
As with the conditions, you can also create any number of actions that are to be executed if the conditions are met. An action always manipulates one field of a game. This ranges from the typical metadata to checkboxes such as Hidden, Installed or HDR.
The individual types of actions can be added using the buttons below the actions grid. A click here also opens an input dialogue or selection box depending on the field type and action. The following action types are available:
- “Add”: Adds the specified value to the field. Applies to all list fields, numbers and date values. In the case of checkboxes, this corresponds to ticking the box.
- “Remove”: Removes the specified value from the field. Only applies to list fields such as genres or tags.
- “Clear field”: Clears the specified field completely. For checkboxes, this corresponds to removing the tick.
There is also a trash bin button for deleting specified actions.