# SQLite Edit or Curl API syntax help

**URL:** <https://forums.plex.tv/t/sqlite-edit-or-curl-api-syntax-help/680657>\
**Category:** Plex Media Server\
**Tags:** server-windows\
**Created:** [January 20, 2021, 10:17pm UTC](https://forums.plex.tv/t/sqlite-edit-or-curl-api-syntax-help/680657 "2021-01-20T22:17:47Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Chris\_Teasdale](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/chris_teasdale/32/10091_2.png) [@Chris\_Teasdale](https://forums.plex.tv/u/Chris_Teasdale)\
**Post date:** [January 20, 2021, 10:17pm UTC](https://forums.plex.tv/t/sqlite-edit-or-curl-api-syntax-help/680657/1 "2021-01-20T22:17:47Z")

</div>

Server Version#: 1.21.1.3876  
Player Version#:NA

Okay I upgraded to the new Movie agent and had many posters changed on me. So I want to change over to using local media assets with artwork stored with my movie files. I did some testing and have the details worked out.

My problem is on my main 4000+ movie collection many of the (meta-items - user\_fields - lockedFields) are set to lock the poster and fanart and local assets doesn’t bypass the lock)

So what I need to do is modify the value like (lockedFields=9|10|13|14) to remove the 9|10 but leave the rest of the values intact, in the example value resulting in (lockedFields=13|14)

I am no expert on SQLite but did make a few changes with DB Browser for SQLite but I am not sure it can do the change I want for the entire section of the database.

I also downed loaded sqlite-tools for windows. I assume this can be done from CMD with this tool. But I could really use some help with the CMD line instructions? Any help is appreciated.

---

<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:** [January 20, 2021, 10:23pm UTC](https://forums.plex.tv/t/sqlite-edit-or-curl-api-syntax-help/680657/2 "2021-01-20T22:23:19Z")

</div>

Check these out -

> [@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…

> [@PMS revert back to old rating from stars](https://forums.plex.tv/t/pms-revert-back-to-old-rating-from-stars/636132/63):
>
> Manual changes to rating (critic ratings) are overwritten by Plex when metadata is refreshed This can be prevented by locking the field. The list of locked fields is stored in metadata\_items.user\_fields. The rating (critic ratings) field is index 5, so metadata\_items.user\_fields is set to lockedFields=5 when locked. If multiple fields are locked they are separated with a |. lockedFields=2|5|7. The audience\_rating field is index 30. To lock critic and audience, use lockedFields=5|30. I was g…

If you want to do it in `sqlite`, check out the **REPLACE()** function, but be sure to take a DB backup first, and be careful not to over-match and replace the wrong things.

---

<div class="post-metadata">

**Author:** ![Chris\_Teasdale](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/chris_teasdale/32/10091_2.png) [@Chris\_Teasdale](https://forums.plex.tv/u/Chris_Teasdale)\
**Post date:** [January 21, 2021, 12:08am UTC](https://forums.plex.tv/t/sqlite-edit-or-curl-api-syntax-help/680657/4 "2021-01-21T00:08:13Z")

</div>

Now I am trying to use curl on Ubuntu:

curl -X PUT “https://(CUSTOM SERVER URL)/library/sections/1/all?type=9&poster.locked=0&X-Plex-Token=XXXXX”

XXXXX replaced by token

But poster was just a guess … I can’t find the syntax for what would unlock all posters and then for fanart?? My server is running behind a reverse proxy, do I need to include port 443? I am now sort of lost on this method. It does seem safer.

---

<div class="post-metadata">

**Author:** ![Chris\_Teasdale](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/chris_teasdale/32/10091_2.png) [@Chris\_Teasdale](https://forums.plex.tv/u/Chris_Teasdale)\
**Post date:** [January 21, 2021, 2:50am UTC](https://forums.plex.tv/t/sqlite-edit-or-curl-api-syntax-help/680657/5 "2021-01-21T02:50:33Z")

</div>

Okay I tracked down the solution:

curl -X PUT “https://(CUSTOM SERVER URL)/library/sections/1/all?type=1&thumb.locked=0&X-Plex-Token=XXXXX”

curl -X PUT “https://(CUSTOM SERVER URL)/library/sections/1/all?type=1&art.locked=0&X-Plex-Token=XXXXX”

I guess “thumb” is for Posters and “art” is for Backgrounds.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/plex/original/3X/2/a/2acb9765406f63293d357b4ec509ec39aa28f2ad.png) [@system](https://forums.plex.tv/u/system)\
**Post date:** [April 21, 2021, 2:50am UTC](https://forums.plex.tv/t/sqlite-edit-or-curl-api-syntax-help/680657/6 "2021-04-21T02:50:34Z")

</div>

Closed on April 21, 2021, 2:50am UTC

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.
