Updating the PLEX database outside Plex - how?

Thanks. Just to finish off, my further investigation has revealed the following, documented here for use by others who may be in similar situation:

  1. Index appears to be 0-based, not 1-based (may not matter in the end)
  2. Index is “per-tag-type”, ie. all Director tags (tag_type=4) have different index numbering from all Collection tags (tag_type=2).
  3. In the table tags (which contain ALL tage for ALL media in the database), the field tag_type can have the following values (these are just the ones I have determined):
    • 1 = Genre
    • 2 = Collection
    • 4 = Director
    • 8 = Country
  4. The user_fields field in metadata_items (which contains all the media in the database, but not the individual files, ie. if there are 2 versions of “Cody Banks”, then only 1 entry here - the “master entry”) can contain a “lockedFields=x|y|z” value, where x, y and z are field numbers that are locked. The field numbers that I have determined are as follows:
    • 1 = Title
    • 2 = Sort Title
    • 3 = Original Title
    • 4 = Studio
    • 5 = Rating
    • 6 = Tagline
    • 7 = Summary
    • 8 = Content Rating
    • 13 / 14 = Originally Available
    • 15 = Genres
    • 16 = Collections
    • 17 = Directors
    • 18 = Writers
    • 24 = Countries
  5. The metadata_type field specifies the type of this metadata_item. I have determined the following values:
    • 1 = (Home) Movie
    • 2 = TV Show
    • 3 = Season
    • 4 = Episode(?)
    • 8 = Music
    • 9 = Music
    • 10 = Music
    • 18 = Collection
    I do not (yet) know the reason for the multiple values used in library type Music. For Library Type 3 and 4, the “parent_id” field links to the TV Show (for type 3) or season (for type 4), field “id” in the same table (metadata_items).

Feel free to add to the lists any new values for the tag_type, metadata_type, and lockedfields that you may have determined… I will then add to the list to keep an updated documentation for future use.

HOWEVER: Please beware that these values are subject to change without notice. They are valid as of Plex Server v1.12.0.4829 (March 2018).

1 Like