A Smart Label Collection is a smart collection that grabs every item with a specific label generated by the program. That label is added to all the items the Collection Builders find instead of being added to a normal collection.
To make a collection a Smart Label Collection, the `smart_label` attribute must added to the collection definition. It functions in two different ways:
1. Define the sort using the Movies/Shows column of the [Sorts Table](#sort-options) below along with any other builder to make that collection a Smart Label Collection.
2. Provide a whole `smart_filter` to determine exactly how the smart collection should be built, ensuring to include `label: <<smart_label>>`, which will link it to the collection labels.
This is extremely useful because smart collections don't follow normal show/hide rules and can eliminate the need to have [Plex Collectionless](plex.md#plex-collectionless) when used correctly. To fix the issue described in [Plex Collectionless](plex.md#plex-collectionless) you would make `Marvel Cinematic Universe` a Smart Label Collection and all other Marvel collection just normal collections, and they will show/hide all the movie properly.
To have the Smart Label Collections to eliminate Plex Collectionless you have to go all in on using them. A good rule of thumb to make sure this works correctly is that every item in your library should have a max of one non-smart collection.
Reach out on the [Plex Meta Manager Discord](https://discord.gg/TsdpsFYqqm) or in the [GitHub Discussions](https://github.com/meisnate12/Plex-Meta-Manager/discussions) for help if you're having any issues getting this to work properly.
## Smart Filter
Uses Plex's [Advanced Filters](https://support.plex.tv/articles/201273953-collections/) to create a smart collection based on the filter parameters provided.
Any Advanced Filter made using the Plex UI should be able to be recreated using `smart_filter`. If you're having trouble getting `smart_filter` to work correctly, build the collection you want inside of Plex's Advanced Filters and take a screenshot of the parameters in the Plex UI and post it in either the [Discussions](https://github.com/meisnate12/Plex-Meta-Manager/discussions) or on [Discord](https://discord.gg/TsdpsFYqqm), and I'll do my best to help you.
like Plex's [Advanced Filters](https://support.plex.tv/articles/201273953-collections/) you have to start each filter with either `any` or `all` as a base. You can only have one base attribute and all filter attributes must be under the base.
Inside the base attribute you can use any filter below or nest more `any` or `all`. You can have as many nested `any` or `all` next to each other as you want. If using multiple `any` or `all` you will have to do so in the form of a list.
**Note: To search by `season`, `episode`, `album`, or `track` you must use the `builder_level` [Detail](../details/metadata) to change the type of items the collection holds.**
| `limit` | **Description:** The max number of item for the filter.<br>**Default:** `all`<br>**Values:** `all` or a number greater than 0 |
| `sort_by` | **Description:** This will control how the filter is sorted in your library. You can do a multi-level sort using a list.<br>**Default:** `random`<br>**Values:** Any sort options for your filter type in the [Sorts Options Table](#sort-options) |
| `validate` | **Description:** Determines if a collection will fail on a validation error<br>**Default:** `true`<br>**Values**: `true` or `false` |
| `actor` | Uses the actor tags to match | ✅ | ✅ | ❌ |
| `audio_language` | Uses the audio language tags to match | ✅ | ✅ | ❌ |
| `collection` | Uses the collection tags to match for top level collections | ✅ | ✅ | ❌ |
| `season_collection` | Uses the collection tags to match for season collections | ❌ | ✅ | ❌ |
| `episode_collection` | Uses the collection tags to match for episode collections | ❌ | ✅ | ❌ |
| `content_rating` | Uses the content rating tags to match | ✅ | ✅ | ❌ |
| `country` | Uses the country tags to match | ✅ | ❌ | ❌ |
| `decade`<sup>1</sup> | Uses the year tag to match the decade | ✅ | ❌ | ❌ |
| `director` | Uses the director tags to match | ✅ | ❌ | ❌ |
| `genre` | Uses the genre tags to match | ✅ | ✅ | ❌ |
| `label` | Uses the label tags to match for top level collections | ✅ | ✅ | ❌ |
| `season_label` | Uses the label tags to match for season collections | ❌ | ✅ | ❌ |
| `episode_label` | Uses the label tags to match for episode collections | ❌ | ✅ | ❌ |
| `network` | Uses the network tags to match<br>**Only works with the New Plex TV Agent** | ❌ | ✅ | ❌ |
| `producer` | Uses the actor tags to match | ✅ | ❌ | ❌ |
| `resolution` | Uses the resolution tags to match | ✅ | ✅ | ❌ |
| `subtitle_language` | Uses the subtitle language tags to match | ✅ | ✅ | ❌ |
| `writer` | Uses the writer tags to match | ✅ | ❌ | ❌ |
| `year`<sup>1</sup> | Uses the year tag to match | ✅ | ✅ | ❌ |
| `episode_year`<sup>1</sup> | Uses the year tag to match | ❌ | ✅ | ❌ |
| `artist_genre` | Uses the Artist's Genre attribute to match | ❌ | ❌ | ✅ |
| `artist_collection` | Uses the Artist's Collection attribute to match | ❌ | ❌ | ✅ |
| `artist_country` | Uses the Artist's Country attribute to match | ❌ | ❌ | ✅ |
| `artist_mood` | Uses the Artist's Mood attribute to match | ❌ | ❌ | ✅ |
| `artist_style` | Uses the Artist's Style attribute to match | ❌ | ❌ | ✅ |
| `artist_label` | Uses the Artist's Label attribute to match | ❌ | ❌ | ✅ |
| `album_genre` | Uses the Album's Genre attribute to match | ❌ | ❌ | ✅ |
| `album_mood` | Uses the Album's Mood attribute to match | ❌ | ❌ | ✅ |
| `album_style` | Uses the Album's Style attribute to match | ❌ | ❌ | ✅ |
| `album_format` | Uses the Album's Format attribute to match | ❌ | ❌ | ✅ |
| `album_type` | Uses the Album's Type attribute to match | ❌ | ❌ | ✅ |
| `album_collection` | Uses the Album's Collection attribute to match | ❌ | ❌ | ✅ |
| `album_source` | Uses the Album's Source attribute to match | ❌ | ❌ | ✅ |
| `album_label` | Uses the Album's Label attribute to match | ❌ | ❌ | ✅ |
| `track_mood` | Uses the Track's Mood attribute to match | ❌ | ❌ | ✅ |
| `track_source` | Uses the Track's Style attribute to match | ❌ | ❌ | ✅ |
| `track_label` | Uses the Track's Label attribute to match | ❌ | ❌ | ✅ |
<sup>1</sup> You can use `current_year` to have PMM use the current years value. This can be combined with a `-#` at the end to subtract that number of years. i.e. `current-2`
| No Modifier | Matches every item where the date attribute is in the last X days<br>**Format:** number of days<br>**Example:** `30` | `is in the last` |
| `.not` | Matches every item where the date attribute is not in the last X days<br>**Format:** number of days<br>**Example:** `30` | `is not in the last` |
| `.before` | Matches every item where the date attribute is before the given date<br>**Format:** MM/DD/YYYY or `today` for the current day<br>**Example:** `01/01/2000` | `is before` |
| `.after` | Matches every item where the date attribute is after the given date<br>**Format:** MM/DD/YYYY or `today` for the current day<br>**Example:** `01/01/2000` | `is after` |
| `.gt` | Matches every item where the number attribute is greater than the given number<br>**Format:** number<br>**Example:** `30`, `1995`, or `7.5` | `is greater than` |
| `.gte` | Matches every item where the number attribute is greater than or equal to the given number<br>**Format:** number<br>**Example:** `30`, `1995`, or `7.5` | N/A |
| `.lt` | Matches every item where the number attribute is less than the given number<br>**Format:** number<br>**Example:** `30`, `1995`, or `7.5` | `is less than` |
| `.lte` | Matches every item where the number attribute is less than or equal to the given number<br>**Format:** number<br>**Example:** `30`, `1995`, or `7.5` | N/A |
| `duration` | Uses the duration attribute to match using minutes<br>**Minimum:** `0` | ✅ | ❌ | ❌ |
| `plays` | Uses the plays attribute to match<br>**Minimum:** `0` | ✅ | ✅ | ❌ |
| `episode_plays` | Uses the Episode's plays attribute to match<br>**Minimum:** `0` | ❌ | ✅ | ❌ |
| `critic_rating` | Uses the critic rating attribute to match<br>**Range:** `0.0` - `10.0` | ✅ | ✅ | ❌ |
| `audience_rating` | Uses the audience rating attribute to match<br>**Range:** `0.0` - `10.0` | ✅ | ✅ | ❌ |
| `user_rating` | Uses the user rating attribute to match<br>**Range:** `0.0` - `10.0` | ✅ | ✅ | ❌ |
| `episode_user_rating` | Uses the user rating attribute of the show's episodes to match<br>**Range:** `0.0` - `10.0` | ❌ | ✅ | ❌ |
| `year`<sup>1</sup> | Uses the year attribute to match<br>**Minimum:** `0` | ✅ | ✅ | ❌ |
| `episode_year`<sup>1</sup> | Uses the Episode's year attribute to match<br>**Minimum:**`0` | ❌ | ✅ | ❌ |
| `album_year`<sup>1</sup> | Uses the Album's year attribute to match<br>**Minimum:** `0` | ❌ | ❌ | ✅ |
| `album_decade`<sup>1</sup> | Uses the Album's decade attribute to match<br>**Minimum:** `0` | ❌ | ❌ | ✅ |
| `album_plays` | Uses the Album's plays attribute to match<br>**Minimum:** `0` | ❌ | ❌ | ✅ |
| `track_plays` | Uses the Track's plays attribute to match<br>**Minimum:** `0` | ❌ | ❌ | ✅ |
| `track_skips` | Uses the Track's skips attribute to match<br>**Minimum:** `0` | ❌ | ❌ | ✅ |
| `artist_user_rating` | Uses the Artist's user rating attribute to match<br>**Range:** `0.0` - `10.0` | ❌ | ❌ | ✅ |
| `album_user_rating` | Uses the Album's user rating attribute to match<br>**Range:** `0.0` - `10.0` | ❌ | ❌ | ✅ |
| `track_user_rating` | Uses the Track's user rating attribute to match<br>**Range:** `0.0` - `10.0` | ❌ | ❌ | ✅ |
<sup>1</sup> You can use `current_year` to have PMM use the current years value. This can be combined with a `-#` at the end to subtract that number of years. i.e. `current-2`
If you specify TMDb Person ID's using the Detail `tmdb_person` and then tell either `actor`, `director`, `producer`, or `writer` to add `tmdb`, the script will translate the TMDb Person IDs into their names and run the filter on those names.