Skip to content

Library Operations

There are a variety of Library Operations that can be utilized in a library.

Within each library, operations can be defined by using the operations attribute, as demonstrated below.

When not using a list under operations the whole operations value is one block.

config.yml Operations sample
libraries:
  Movies:
    collection_files:
      - default: imdb
    operations:
      mass_critic_rating_update: tmdb
      split_duplicates: true

Operation Blocks

You can create individual blocks of operations by using a list under operations with each item in the list being a "block" that can be individually scheduled.

config.yml Operation Blocks sample
libraries:
  Movies:
    collection_files:
      - default: imdb
    operations:
      - schedule: weekly(friday)
        mass_critic_rating_update: tmdb
      - schedule: weekly(saturday)
        split_duplicates: true

A Note on Data Sources

Several of these operations use data from external sources such as MDBList. Some of these sources have free and paid tiers of access. Your entire library may not be able to be updated in a single run on a free tier; you may need to make multiple runs over some number of days. For example, MDBList's free tier is limited [at time of writing] to 1000 API requests daily. Changes in external site paid/free status and limits are not under Kometa's control.

Operation Attributes

Assets For All
assets_for_all - Used to search the asset directories for images for all items in the library.

Ordinarily, Kometa searches the asset directories for collection artwork. Enabling this Operation tells Kometa to searches the asset directories for images for all items [movies, shows, seasons, episodes, etc] in the library.


Attribute: assets_for_all

Accepted Values: true or false.

Example
libraries:
  Movies:
    operations:
      assets_for_all: false
Delete Collections
delete_collections - Deletes collections based on a set of given attribute.

Deletes collections based on a set of given attributes. The Collection must match all set attributes to be deleted.


Attribute: delete_collections

Accepted Values: There are a few different options to determine how the delete_collections works.

managed: trueCollection must be Managed to be deleted.
(collection has the Kometa label)
managed: falseCollection must be Unmanaged to be deleted.
(collection does not have the Kometa label)
configured: trueCollection must be Configured to be deleted.
(collection is in the config file of the specific Kometa run)
configured: falseCollection must be Unconfigured to be deleted.
(collection is not in the config file of the specific Kometa run)
less: ###Collection must contain less than the given number of items to be deleted.
### is a Number greater than 0
Optional value which if undefined means collections will be deleted regardless of how many items they have.
ignore_empty_smart_collections: falseDo not apply less check to empty smart collections
This allows retaining things like smart collections that show movies without subtitles or the like.

The collection does not need to be scheduled to be considered configured and only needs to be in the config file.

Example

Removes all Managed Collections (Collections with the Kometa Label) that are not configured in the Current Run.

libraries:
  Movies:
    operations:
      delete_collections:
        configured: false
        managed: true
Mass Genre Update
mass_genre_update - Updates the genres of every item in the library.

Updates every item's genres in the library to the chosen site's genres.


Attribute: mass_genre_update

Accepted Values: Source or List of sources to use in that order.

tmdbUse TMDb for Genres.
tvdbUse TVDb for Genres.
imdbUse IMDb for Genres.
omdbUse IMDb through OMDb for Genres.
anidbUse AniDB Main Tags for Genres.
anidb_3_0Use AniDB Main Tags and All 3 Star Tags and above for Genres.
anidb_2_5Use AniDB Main Tags and All 2.5 Star Tags and above for Genres.
anidb_2_0Use AniDB Main Tags and All 2 Star Tags and above for Genres.
anidb_1_5Use AniDB Main Tags and All 1.5 Star Tags and above for Genres.
anidb_1_0Use AniDB Main Tags and All 1 Star Tags and above for Genres.
anidb_0_5Use AniDB Main Tags and All 0.5 Star Tags and above for Genres.
malUse MyAnimeList for Genres.
lockLock all Genre Field.
unlockUnlock all Genre Field.
removeRemove all Genres and Lock all Field.
resetRemove all Genres and Unlock all Field.
List of Strings for Genres. (["String 1", "String 2"])

Example
libraries:
  Movies:
    operations:
      mass_genre_update: 
        - imdb
        - tmdb
        - ["Unknown"]
Mass Content Rating Update
mass_content_rating_update - Updates the content rating of every item in the library.

Updates every item's content rating in the library to the chosen site's content rating.


Attribute: mass_content_rating_update

Accepted Values: Source or List of sources to use in that order.

Note on mdb sources

MDBList is not a live reflection of third-party sites such as CommonSense and Trakt. The data on MDBList is often days, weeks and months out of date as it is only periodically refreshed. As such, the data that Kometa applies using mdb_ operations applies may not be the same as you see if you visit those third-party sources directly.

mdbUse MDBList for Content Ratings.
mdb_commonsenseUse Common Sense Rating through MDBList for Content Ratings.
mdb_commonsense0Use Common Sense Rating with Zero Padding through MDBList for Content Ratings.
mdb_age_ratingUse MDBList Age Rating for Content Ratings.
mdb_age_rating0Use MDBList Age Rating with Zero Padding for Content Ratings.
omdbUse IMDb through OMDb for Content Ratings.
malUse MyAnimeList for Content Ratings.
lockLock Content Rating Field.
unlockUnlock Content Rating Field.
removeRemove Content Rating and Lock Field.
resetRemove Content Rating and Unlock Field.
Any String for Content Ratings.

Example
libraries:
  Movies:
    operations:
      mass_content_rating_update: 
        - mdb_commonsense
        - mdb_age_rating
        - NR
Mass Original Title Update
mass_original_title_update - Updates the original title of every item in the library.

Updates every item's original title in the library to the chosen site's original title.


Attribute: mass_original_title_update

Accepted Values: Source or List of sources to use in that order

anidbUse AniDB Main Title for Original Titles.
anidb_officialUse AniDB Official Title based on the language attribute in the config file for Original Titles.
malUse MyAnimeList Main Title for Original Titles.
mal_englishUse MyAnimeList English Title for Original Titles.
mal_japaneseUse MyAnimeList Japanese Title for Original Titles.
lockLock Original Title Field.
unlockUnlock Original Title Field.
removeRemove Original Title and Lock Field.
resetRemove Original Title and Unlock Field.
Any String for Original Titles.

Example
libraries:
  Anime:
    operations:
      mass_original_title_update: 
        - anidb_official
        - anidb
        - Unknown
Mass Studio Update
mass_studio_update - Updates the studio of every item in the library.

Updates every item's studio in the library to the chosen site's studio.


Attribute: mass_studio_update

Accepted Values: Source or List of sources to use in that order

anidbUse AniDB Animation Work for Studio.
malUse MyAnimeList Studio for Studio.
tmdbUse TMDb Studio for Studio.
lockLock Studio Field.
unlockUnlock Studio Field.
removeRemove Studio and Lock Field.
resetRemove Studio and Unlock Field.
Any String for Studio.

Example
libraries:
  Anime:
    operations:
      mass_studio_update: 
        - mal
        - anidb
        - Unknown
Mass Originally Available Update
mass_originally_available_update - Updates the originally available date of every item in the library.

Updates every item's originally available date in the library to the chosen site's date.

Tip

As plex does not allow this field to be empty, using remove or reset will set the date to the Plex default date, which is 1969-12-31.


Attribute: mass_originally_available_update

Accepted Values: Source or List of sources to use in that order.

Note on mdb sources

MDBList is not a live reflection of third-party sites such as CommonSense and Trakt. The data on MDBList is often days, weeks and months out of date as it is only periodically refreshed. As such, the data that Kometa applies using mdb_ operations applies may not be the same as you see if you visit those third-party sources directly.

tmdbUse TMDb Release Date.
tvdbUse TVDb Release Date.
omdbUse IMDb Release Date through OMDb.
mdbUse MDBList Release Date.
mdb_digitalUse MDBList Digital Release Date.
anidbUse AniDB Release Date.
malUse MyAnimeList Release Date.
lockLock Originally Available Field.
unlockUnlock Originally Available Field.
removeRemove Originally Available and Lock Field.
resetRemove Originally Available and Unlock Field.
Any String in the Format: YYYY-MM-DD for Originally Available. (2022-05-28)

Example
libraries:
  TV Shows:
    operations:
      mass_originally_available_update: 
        - mdb_digital
        - mdb
        - 1900-01-01
Mass Added At Update
mass_added_at_update - Updates the added at date of every item in the library.

Updates every item's added at date in the library to the chosen site's date.


Attribute: mass_added_at_update

Accepted Values: Source or List of sources to use in that order.

Note on mdb sources

MDBList is not a live reflection of third-party sites such as CommonSense and Trakt. The data on MDBList is often days, weeks and months out of date as it is only periodically refreshed. As such, the data that Kometa applies using mdb_ operations applies may not be the same as you see if you visit those third-party sources directly.

tmdbUse TMDb Release Date.
tvdbUse TVDb Release Date.
omdbUse IMDb Release Date through OMDb.
mdbUse MDBList Release Date.
mdb_digitalUse MDBList Digital Release Date.
anidbUse AniDB Release Date.
malUse MyAnimeList Release Date.
lockLock Added At Field.
unlockUnlock Added At Field.
removeRemove Added At and Lock Field.
resetRemove Added At and Unlock Field.
Any String in the Format: YYYY-MM-DD for Added At. (2022-05-28)

Example
libraries:
  TV Shows:
    operations:
      mass_added_at_update: 
        - mdb_digital
        - mdb
        - 1900-01-01
Mass Rating Update
mass_***_rating_update - Updates the audience/critic/user rating of every item in the library.

Updates every item's audience/critic/user rating in the library to the chosen site's rating.

Important Note

This does not affect the icons displayed in the Plex UI. This will place the number of your choice in the relevant field in the Plex database. In other words, if Plex is configured to use Rotten Tomatoes ratings, then no matter what happens with this mass rating update Operation, the icons in the Plex UI will remain Rotten Tomatoes. The human who decided to put TMDb ratings in the critic slot and Letterboxd ratings in the audience slot is the only party who knows that the ratings are no longer Rotten Tomatoes. One primary use of this feature is to put ratings overlays on posters. More information on what Kometa can do with these ratings can be found here.


Attribute: mass_audience_rating_update/mass_critic_rating_update/mass_user_rating_update

Accepted Values: Source or List of sources to use in that order.

Note on mdb sources

MDBList is not a live reflection of third-party sites such as CommonSense and Trakt. The data on MDBList is often days, weeks and months out of date as it is only periodically refreshed. As such, the data that Kometa applies using mdb_ operations applies may not be the same as you see if you visit those third-party sources directly.

anidb_averageUse AniDB Average.
anidb_ratingUse AniDB Rating.
anidb_scoreUse AniDB Review Score.
imdbUse IMDb Rating.
malUse MyAnimeList Score.
mdb_averageUse MDBList Average Score.
mdb_imdbUse IMDb Rating through MDBList.
mdb_letterboxdUse Letterboxd Rating through MDBList.
mdb_metacriticUse Metacritic Rating through MDBList.
mdb_metacriticuserUse Metacritic User Rating through MDBList.
mdb_myanimelistUse MyAnimeList Rating through MDBList.
mdb_tmdbUse TMDb Rating through MDBList.
mdb_tomatoesUse Rotten Tomatoes Rating through MDBList.
mdb_tomatoesaudienceUse Rotten Tomatoes Audience Rating through MDBList.
mdb_traktUse Trakt Rating through MDBList.
mdbUse MDBList Score.
omdb_metascoreUse Metacritic Metascore through OMDb.
omdb_tomatoesUse Rotten Tomatoes rating through OMDb.
omdbUse IMDbRating through OMDb.
plex_imdbUse IMDB Rating through Plex.
plex_tmdbUse TMDB Rating through Plex.
plex_tomatoesUse Rotten Tomatoes Rating through Plex.
plex_tomatoesaudienceUse Rotten Tomatoes Audience Rating through Plex.
tmdbUse TMDb Rating.
trakt_userUse Trakt User's Personal Rating.
traktUse Trakt Rating.
lockLock Rating Field.
unlockUnlock Rating Field.
removeRemove Rating and Lock Field.
resetRemove Rating and Unlock Field.
Any Number between 0.0-10.0 for Ratings.

Example
libraries:
  Movies:
    operations:
      mass_audience_rating_update: 
        - mdb
        - mdb_average
        - 2.0
      mass_critic_rating_update:
        - imdb
        - omdb
        - 2.0
      mass_user_rating_update: 
        - trakt_user
        - 2.0
Mass Episode Rating Update
mass_episode_***_rating_update - Updates the audience/critic/user rating of every episode in the library.

Updates every item's episode's audience/critic/user rating in the library to the chosen site's rating.

Important Note

This does not affect the icons displayed in the Plex UI. This will place the number of your choice in the relevant field in the Plex database. In other words, if Plex is configured to use Rotten Tomatoes ratings, then no matter what happens with this mass rating update Operation, the icons in the Plex UI will remain Rotten Tomatoes. The human who decided to put TMDb ratings in the critic slot and Letterboxd ratings in the audience slot is the only party who knows that the ratings are no longer Rotten Tomatoes. One primary use of this feature is to put ratings overlays on posters. More information on what Kometa can do with these ratings can be found here.


Attribute: mass_episode_audience_rating_update/mass_episode_critic_rating_update/mass_episode_user_rating_update

Accepted Values: Source or List of sources to use in that order.

imdbUse IMDb Rating.
plex_imdbUse IMDB Rating through Plex.
plex_tmdbUse TMDB Rating through Plex.
tmdbUse TMDb Rating.
traktUse Trakt Rating.
lockLock Rating Field.
unlockUnlock Rating Field.
removeRemove Rating and Lock Field.
resetRemove Rating and Unlock Field.
Any Number between 0.0-10.0 for Ratings.

Example
libraries:
  TV Shows:
    operations:
      mass_episode_audience_rating_update: 
        - tmdb
        - 2.0
      mass_episode_critic_rating_update: 
        - imdb
        - 2.0
Mass Poster Update
mass_poster_update - Updates the poster of every item in the library.

Updates every item's poster to the chosen sites poster. Will fall back to plex if the given option fails. Assets will be used over anything else.

Warning

When used in combination with Overlays, this could cause Kometa to reset the poster and then reapply all overlays on each run, which will result in image bloat.


Attribute: mass_poster_update

Accepted Values:

sourceSource of the poster update.tmdb, plex, lock, or unlock
seasonsUpdate season posters while updating shows. Default: truetrue or false
episodesUpdate episode posters while updating shows. Default: truetrue or false
ignore_lockedSkip updating image if the poster field is locked1.
Default: false
true or false
ignore_overlaysSkip updating image if the current image has an Overlay2.
Default: false
true or false

  1. The poster field will be locked if a previous mass_poster_update was run or if an Overlay has been applied.
  2. Kometa checks for the Overlay label on the item in Plex to determine if an Overlay is applied.
Example
libraries:
  TV Shows:
    operations:
      mass_poster_update:
        source: tmdb
        seasons: false
        episodes: false
Mass Background Update
mass_background_update - Updates the background of every item in the library.

Updates every item's background to the chosen sites background. Will fall back to plex if the given option fails. Assets will be used over anything else.

Warning

When used in combination with Overlays, this could cause Kometa to reset the background and then reapply all overlays on each run, which will result in image bloat.


Attribute: mass_background_update

Accepted Values:

sourceSource of the poster update.tmdb, plex, lock, or unlock
seasonsUpdate season posters while updating shows. Default: truetrue or false
episodesUpdate episode posters while updating shows. Default: truetrue or false
ignore_lockedSkip updating image if the poster field is locked.1 Default: falsetrue or false

  1. The background field will be locked if a previous mass_background_update was run.
Example
libraries:
  TV Shows:
    operations:
      mass_background_update:
        source: tmdb
        seasons: false
        episodes: false
Mass IMDb Parental Labels
mass_imdb_parental_labels - Adds IMDb Parental labels of every item in the library.

Updates every item's labels in the library to match the IMDb Parental Guide.


Attribute: mass_imdb_parental_labels

Accepted Values:

noneApply all Parental Labels with a value of None, Mild, Moderate, or Severe.
mildApply all Parental Labels with a value of Mild, Moderate, or Severe.
moderateApply all Parental Labels with a value of Moderate or Severe.
severeApply all Parental Labels with a value of Severe.

Example
libraries:
  TV Shows:
    operations:
      mass_imdb_parental_labels: severe
Mass Collection Mode
mass_collection_mode - Updates the Collection Mode of every item in the library.

Updates every Collection in your library to the specified Collection Mode.


Attribute: mass_collection_mode

Accepted Values:

defaultLibrary default.
hideHide Collection.
hide_itemsHide Items in this Collection.
show_itemsShow this Collection and its Items.

Example
libraries:
  TV Shows:
    operations:
      mass_collection_mode: hide
Update Blank Track Titles
update_blank_track_titles - Updates blank track titles of every item in the library.

Search though every track in a music library and replace any blank track titles with the tracks sort title.


Attribute: update_blank_track_titles

Accepted Values: true or false.

Example
libraries:
  Music:
    operations:
      update_blank_track_titles: true
Remove Title Parentheses
remove_title_parentheses - Removes title parentheses of every item in the library.

Search through every title and remove all ending parentheses in an items title if the title is not locked.


Attribute: remove_title_parentheses

Accepted Values: true or false.

Example
libraries:
  Music:
    operations:
      remove_title_parentheses: true
Split Duplicates
split_duplicates - Splits all duplicate items found in this library.

Splits all duplicate items found in this library.


Attribute: split_duplicates

Accepted Values: true or false.

Example
libraries:
  Movies:
    operations:
      split_duplicates: true
Radarr Add All
radarr_add_all - Adds every item in the library to Radarr.

Adds every item in the library to Radarr.

Warning

The existing paths in plex will be used as the root folder of each item, if the paths in Plex are not the same as your Radarr paths you can use the plex_path and radarr_path Radarr details to convert the paths.


Attribute: radarr_add_all

Accepted Values: true or false.

Example
libraries:
  Movies:
    operations:
      radarr_add_all: true
Radarr Remove By Tag
radarr_remove_by_tag - Removes every item from Radarr with the Tags given.

Removes every item from Radarr with the Tags given.


Attribute: radarr_remove_by_tag

Accepted Values: List or comma separated string of tags.

Example
libraries:
  Movies:
    operations:
      radarr_remove_by_tag: mytag1, mytag2
Sonarr Add All
sonarr_add_all - Adds every item in the library to Sonarr.

Adds every item in the library to Sonarr.

Warning

The existing paths in plex will be used as the root folder of each item, if the paths in Plex are not the same as your Sonarr paths you can use the plex_path and sonarr_path Sonarr details to convert the paths.


Attribute: sonarr_add_all

Accepted Values: true or false.

Example
libraries:
  TV Shows:
    operations:
      sonarr_add_all: true
Sonarr Remove By Tag
sonarr_remove_by_tag - Removes every item from Sonarr with the Tags given.

Removes every item from Sonarr with the Tags given.


Attribute: sonarr_remove_by_tag

Accepted Values: List or comma separated string of tags.

Example
libraries:
  TV Shows:
    operations:
      sonarr_remove_by_tag: mytag1, mytag2
Genre Mapper
genre_mapper - Maps genres in your library to be changed to other genres.

Maps genres in your library to be changed to other genres.


Attribute: genre_mapper

Accepted Values: Each attribute under genre_mapper is a separate mapping and has two parts.

keyGenre you want mapped to the valueAction/Adventure, Action & Adventure in the example below.
valueWhat the genre will end up asAction in the example below.

Example

This example will change go through every item in your library and change the genre Action/Adventure or Action & Adventure to Action and Romantic Comedy to Comedy.

libraries:
  Movies:
    # Metadata and Overlay files here
    operations:
      genre_mapper:
        "Action/Adventure": Action 
        "Action & Adventure": Action
        Romantic Comedy: Comedy

To just Remove a Genre without replacing it just set the Genre to nothing like this.

libraries:
  Movies:
    # Metadata and Overlay files here
    operations:
      genre_mapper:
        "Action/Adventure": Action 
        "Action & Adventure": Action
        Romantic Comedy:

The above example will change go through every item in your library and change the genre Action/Adventure or Action & Adventure to Action and remove every instance of the Genre Romantic Comedy.

Content Rating Mapper
content_rating_mapper - Maps content ratings in your library to be changed to other content ratings.

Maps content ratings in your library to be changed to other content ratings.


Attribute: content_rating_mapper

Accepted Values: Each attribute under content_rating_mapper is a separate mapping and has two parts.

keyContent rating you want mapped to the value.PG, PG-13 in the example below.
valueWhat the content rating will end up as.Y-10 in the example below.

Example

This example will change go through every item in your library and change the content rating PG or PG-13 to Y-10 and R to Y-17.

libraries:
  Movies:
    # Metadata and Overlay files here
    operations:
      content_rating_mapper:
        PG: Y-10 
        "PG-13": Y-10
        R: Y-17

To just Remove a content rating without replacing it just set the content rating to nothing like this.

libraries:
  Movies:
    # Metadata and Overlay files here
    operations:
      content_rating_mapper:
        PG: Y-10 
        "PG-13": Y-10
        R:

The above example will change go through every item in your library and change the content rating PG or PG-13 to Y-10 and remove every instance of the content rating R.

Metadata Backup
metadata_backup - Creates/Maintains a Kometa Metadata File for the library.

Creates/Maintains a Kometa Metadata File with a full metadata mapping based on the library's items locked attributes.

If you point to an existing Metadata File then Kometa will sync the changes to the file, so you won't lose non plex changes in the file.


Attribute: metadata_backup

Accepted Values: There are a few different options to determine how the metadata_backup works.

pathPath to where the metadata will be saved/maintained.
Default: <<library_name>>_Metadata_Backup.yml in your config folder
Values: Path to Metadata File.
excludeExclude all listed attributes from being saved in the Collection File.
Values: Comma-separated string or list of attributes.
sync_tagsAll Tag Attributes will have the .sync option and blank attribute will be added to sync.
Default: false
Values: true or false.
add_blank_entriesWill add a line for entries that have no metadata changes.
Default: true
Values: true or false.

Example
libraries:
  Movies:
    operations:
      metadata_backup:
        path: config/Movie_Backup.yml
        sync_tags: true
        add_blank_entries: false

The resulting Metadata File can be used like any other Metadata File in Kometa, for example, you can use it to apply metadata to a new library or to restore metadata to a library.

Example
libraries:
  Movies:
    metadata_files:
      file: config/Movie_Backup.yml  # restore this Metadata File to the library
  Movies - Alternate:
    metadata_files:
      file: config/Movie_Backup.yml  # apply this Metadata File to the library