How to update media file path from the Web API

Using the Web API, how do I update the file path of media?

I know how to get the metadata of an item (library/metadata/${metadataId} using GET) and I see file field buried in there:

{ Media: [
  { Part: [
    { file }
  ] }
] }

This structure makes sense to me. I understand there might be multiple media sources for an item; like a 1080p version and a 720p version. And then I understand how one media source might have multiple parts; like cd1, cd2, etc.

Also, if updating the media file path (or media part file path) is just not possible at this time, I understand. Thanks for taking the time to read my question. :smile:


FWIW, I understand the API enough that:

  • I can update a field of an item (library/metadata/${metadataId}?type=1&${field}.value=${newValue} using PUT).
  • I can lock a field of an item (library/metadata/${metadataId}?${field}.locked=${newValue} using PUT).
  • I can delete an item: (library/metadata/${metadataId} using DELETE).
  • I can delete individual media (library/metadata/${metadataId}/media/${mediaId} using DELETE).

I feel so close.

What do you mean by updating the filepath?
(And AFAIK, can’t be done)

Are you moving things around?
If so, refresh the library, but do be careful with empty trash, since that might nuke stuff not intentionally!

@dane22, yes, I am moving the file, which is why I want to update the file path. Thanks for the followup. Does that clear up my question?

If I’m unable to update the path myself, I must otherwise refresh the entire section (library/sections/${sectionId}/refresh using GET), which feels too nuclear.

Indeed…But the only way I know off