Jump to content

ItemUpdateService cannot change the SortName and ForcedSortName


hisune

Recommended Posts

hisune

ItemUpdateService cannot change the SortName and ForcedSortName

Quote

curl 'http://192.168.1.1:8096/Users/{userid}/Items/{item_id}?api_key={api_key}'

return the full item BaseItemDto

Modify SortName and ForcedSortName in BaseItemDto, then make a post request:

Quote

curl -X POST -d '{"SortName":"test","ForcedSortName":"test", ....... and many others from BaseItemDto......}' 'http://192.168.1.1:8096/Items/{item_id}?ItemId={item_id}&api_key={api_key}'

got a 204 response, but SortName and ForcedSortName cant modified success

I tested that the Name field can be modified success

Edited by hisune
Link to comment
Share on other sites

hisune
8 hours ago, Luke said:

Hi, what type of item are you trying to update this for?

Movies and TV series. 

Link to comment
Share on other sites

OK, please provide a specific example and attach the corresponding emby server log. thanks.

Link to comment
Share on other sites

hisune
42 minutes ago, Luke said:

OK, please provide a specific example and attach the corresponding emby server log. thanks.

 

The steps to reproduce the problem are the same as described in my post. First use the interface /Users/{userid}/Items/{item_id} to get all the information of a movie, then modify the SortName and ForcedSortName fields inside, and then request the interface /Items/{item_id} to modify the movie's metadata.

The server log when requesting to modify the metadata interface is as follows:

Quote

2022-05-24 09:48:40.975 Debug Server: http/1.1 GET http://172.16.1.126:8096/emby/System/Logs/embyserver.txt/Lines?SortBy=SortName&SortOrder=Ascending&Fields=BasicSyncInfo,CanDelete,Container,PrimaryImageAspectRatio,ProductionYear,Status,EndDate,CommunityRating,OfficialRating,CriticRating,Prefix&ImageTypeLimit=1&EnableImageTypes=Primary,Backdrop,Thumb&StartIndex=200&Sanitize=true&Limit=100&EnableTotalRecordCount=false&X-Emby-Client=Emby Web&X-Emby-Device-Name=Chrome Windows&X-Emby-Device-Id={replace_sensitive_info}&X-Emby-Client-Version=4.7.0.60. UserAgent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/101.0.4951.64 Safari/537.36 Edg/101.0.1210.53
2022-05-24 09:48:40.986 Debug Server: http/1.1 Response 200 to host2. Time: 12ms. http://172.16.1.126:8096/emby/System/Logs/embyserver.txt/Lines?SortBy=SortName&SortOrder=Ascending&Fields=BasicSyncInfo,CanDelete,Container,PrimaryImageAspectRatio,ProductionYear,Status,EndDate,CommunityRating,OfficialRating,CriticRating,Prefix&ImageTypeLimit=1&EnableImageTypes=Primary,Backdrop,Thumb&StartIndex=200&Sanitize=true&Limit=100&EnableTotalRecordCount=false&X-Emby-Client=Emby Web&X-Emby-Device-Name=Chrome Windows&X-Emby-Device-Id={replace_sensitive_info}&X-Emby-Client-Version=4.7.0.60
2022-05-24 09:49:39.875 Info Server: http/1.1 POST http://172.16.1.126:8096/emby/Items/26. UserAgent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/101.0.4951.64 Safari/537.36 Edg/101.0.1210.53
2022-05-24 09:49:39.879 Debug SqliteItemRepository: Public GetItemLinks
2022-05-24 09:49:39.881 Debug App: Saving nfo metadata for E:\电影\冒险\007:大破量子危机 (2008)\007:大破量子危机 (2008) 1080p AAC.mp4 to E:\电影\冒险\007:大破量子危机 (2008)\007:大破量子危机 (2008) 1080p AAC.nfo.
2022-05-24 09:49:39.882 Info Server: http/1.1 Response 204 to host2. Time: 7ms. http://172.16.1.126:8096/emby/Items/26
2022-05-24 09:49:43.284 Debug Server: http/1.1 GET http://172.16.1.126:8096/emby/Users/{replace_sensitive_info}?X-Emby-Client=Emby Web&X-Emby-Device-Name=Chrome Windows&X-Emby-Device-Id={replace_sensitive_info}&X-Emby-Client-Version=4.7.0.60. UserAgent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/101.0.4951.64 Safari/537.36 Edg/101.0.1210.53
2022-05-24 09:49:43.284 Debug Server: http/1.1 GET http://172.16.1.126:8096/emby/System/Configuration?X-Emby-Client=Emby Web&X-Emby-Device-Name=Chrome Windows&X-Emby-Device-Id={replace_sensitive_info}&X-Emby-Client-Version=4.7.0.60. UserAgent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/101.0.4951.64 Safari/537.36 Edg/101.0.1210.53
2022-05-24 09:49:43.286 Debug Server: http/1.1 Response 200 to host2. Time: 2ms. http://172.16.1.126:8096/emby/System/Configuration?X-Emby-Client=Emby Web&X-Emby-Device-Name=Chrome Windows&X-Emby-Device-Id={replace_sensitive_info}&X-Emby-Client-Version=4.7.0.60
2022-05-24 09:49:43.286 Debug Server: http/1.1 Response 200 to host2. Time: 2ms. http://172.16.1.126:8096/emby/Users/{replace_sensitive_info}?X-Emby-Client=Emby Web&X-Emby-Device-Name=Chrome Windows&X-Emby-Device-Id={replace_sensitive_info}&X-Emby-Client-Version=4.7.0.60
2022-05-24 09:49:43.287 Debug Server: http/1.1 GET http://172.16.1.126:8096/emby/System/Logs/Query?SortBy=SortName&SortOrder=Ascending&Fields=BasicSyncInfo,CanDelete,Container,PrimaryImageAspectRatio,ProductionYear,Status,EndDate,CommunityRating,OfficialRating,CriticRating,Prefix&ImageTypeLimit=1&EnableImageTypes=Primary,Backdrop,Thumb&StartIndex=0&Limit=30&X-Emby-Client=Emby Web&X-Emby-Device-Name=Chrome Windows&X-Emby-Device-Id={replace_sensitive_info}&X-Emby-Client-Version=4.7.0.60. UserAgent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/101.0.4951.64 Safari/537.36 Edg/101.0.1210.53
2022-05-24 09:49:43.288 Debug Server: http/1.1 Response 200 to host2. Time: 2ms. http://172.16.1.126:8096/emby/System/Logs/Query?SortBy=SortName&SortOrder=Ascending&Fields=BasicSyncInfo,CanDelete,Container,PrimaryImageAspectRatio,ProductionYear,Status,EndDate,CommunityRating,OfficialRating,CriticRating,Prefix&ImageTypeLimit=1&EnableImageTypes=Primary,Backdrop,Thumb&StartIndex=0&Limit=30&X-Emby-Client=Emby Web&X-Emby-Device-Name=Chrome Windows&X-Emby-Device-Id={replace_sensitive_info}&X-Emby-Client-Version=4.7.0.60
2022-05-24 09:49:44.356 Debug Server: http/1.1 GET http://172.16.1.126:8096/emby/System/Logs/embyserver.txt/Lines?SortBy=SortName&SortOrder=Ascending&Fields=BasicSyncInfo,CanDelete,Container,PrimaryImageAspectRatio,ProductionYear,Status,EndDate,CommunityRating,OfficialRating,CriticRating,Prefix&ImageTypeLimit=1&EnableImageTypes=Primary,Backdrop,Thumb&StartIndex=0&Sanitize=true&Limit=100&X-Emby-Client=Emby Web&X-Emby-Device-Name=Chrome Windows&X-Emby-Device-Id={replace_sensitive_info}&X-Emby-Client-Version=4.7.0.60. UserAgent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/101.0.4951.64 Safari/537.36 Edg/101.0.1210.53

 

Edited by hisune
Link to comment
Share on other sites

What happens when you edit the sort title using the metadata editor? How does that compare?

Link to comment
Share on other sites

hisune

After adding the following changes, the SortName can be modified as expected.

Quote

{  

   ...... // others

   "SortName":"DPLZWJ",
   "ForcedSortName":"DPLZWJ",
   "LockedFields"": [ // ------------> This is the added modification
     "SortName" // ------------> This is the added modification
   ],

   ...... // others

}

It won't work if you just modify the following:

Quote

{  

   ...... // others

   "SortName":"DPLZWJ",
   "ForcedSortName":"DPLZWJ",

   ...... // others

}

Why does this happen? 

Link to comment
Share on other sites

  • 1 month later...
kaelin

I was having this same problem and hisune was right. Once I added "SortName" to LockedFields, It started updating the Sort Title again. Not sure why that is.

Link to comment
Share on other sites

hisune
13 minutes ago, kaelin said:

I was having this same problem and hisune was right. Once I added "SortName" to LockedFields, It started updating the Sort Title again. Not sure why that is.

Yes, I do the same

Link to comment
Share on other sites

OK this is sort of normal, notice how the metadata editor auto-locks those fields if you edit them. If you don't lock the sort title then the server will just end up resetting it.

I realize it isn't obvious that you need to do this though.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...