# Set "lock" fields via sqlite?

**URL:** <https://forums.plex.tv/t/set-lock-fields-via-sqlite/734117>\
**Category:** Dev/API Corner\
**Tags:** server-windows, library-management\
**Created:** [August 5, 2021, 4:23pm UTC](https://forums.plex.tv/t/set-lock-fields-via-sqlite/734117 "2021-08-05T16:23:58Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![Volts](https://avatars.discourse-cdn.com/v4/letter/v/a5b964/32.png) [@Volts](https://forums.plex.tv/u/Volts)\
**Post date:** [August 5, 2021, 8:16pm UTC](https://forums.plex.tv/t/set-lock-fields-via-sqlite/734117/3 "2021-08-05T20:16:22Z")

</div>

Because `lockedFields` is pipe-delimited, I dislike editing it directly with SQLite.

So another option is to use the Plex HTTP API. There’s a nice example of how to do so, including locking **genre** , here:

> [@New Music Metadata handling](https://forums.plex.tv/t/new-music-metadata-handling/469988/10):
>
> Ahh, gotcha. There unfortunately no way to do that in the GUI. But of course you can edit your database directly and remove those locks on all items in one sweep. If you have access to the curl command or have an equivalent way of sending commands per http to your server, here is a sequence of commands to unlock them all. First you need to determine the library ID of your music library. You can get it from the [Plex XML info](https://support.plex.tv/hc/en-us/articles/201998867-Investigate-Media-Information-and-Formats "Plex XML info") of one of the music tracks (or by simply hovering the mouse cursor o…

I usually prefer to use the (unofficial) [Python PlexAPI](https://github.com/pkkid/python-plexapi) for this sort of thing.

---

_[View the full topic](https://forums.plex.tv/t/set-lock-fields-via-sqlite/734117)._
