Jellyfin Forum
Change Item's Name using the API - Printable Version

+- Jellyfin Forum (https://forum.jellyfin.org)
+-- Forum: Development (https://forum.jellyfin.org/f-development)
+--- Forum: Server Development (https://forum.jellyfin.org/f-server-development)
+--- Thread: Change Item's Name using the API (/t-change-item-s-name-using-the-api)



Change Item's Name using the API - Facundo Batista - 2023-12-12

Hello!

tl;dr: I cannot set the item's name, I get a 400.

I'm getting an item from the SERVER/Items endpoint, if I print it I see:

Code:
{'BackdropImageTags': ['88c073d8ed4d352f1b9dc2a7fca2029b'],
'ChannelId': None,
'CommunityRating': 7.607,
'Container': 'mkv,webm',
'CriticRating': 94,
'HasSubtitles': True,
'Id': '664d7ffdf0922c7eee0ea4f611481ae4',
'ImageBlurHashes': {
    'Backdrop': {'88c073d8ed4d352f1b9dc2a7fca2029b': 'WKJ$~m%Lbu5,-o^Pi_-VIpNGNa$j0|n$Rj=|%1w^t6-os.w]xZ9]'},
    'Logo': {'77deb07dd1c82eb0aa484c6db58cf951c': 'HRKj+Mt75+n%I:J7NaR*oL}Fn%-BWVxaf+soayNa'},
    'Primary': {'49425ae25bbc6c83304e8dc48eae0d30': 'dbKdPd?Go}?Gcu%2xst7KmNG$*t6IvxtoIay9bs+R%R*'}
},
'ImageTags': {
    'Logo': '77deb07dd1c82eb0aa484c6db58f951c',
    'Primary': '49425ae25bbc6c83304e8dc48eae0d30'
},
'IsFolder': False,
'LocationType': 'FileSystem',
'MediaType': 'Video',
'Name': 'El día de la marmota',
'OfficialRating': 'PG',
'OriginalTitle': 'Groundhog Day',
'Path': '/data/Permanente/Eterno/Groundhog Day.mkv',
'PremiereDate': '1993-02-11T00:00:00.0000000Z',
'ProductionYear': 1993,
'RunTimeTicks': 60641710080,
'ServerId': '621086aaa8ef40939c2945a44a7b37bc',
'Type': 'Movie',
'VideoType': 'VideoFile'}


So I change the name and then hit update:

Code:
    media["Name"] = "Groundhog Day"
    resp = requests.post(f"{jf_server}/Items/{media['Id']}", json=media, headers=headers)

All I get is a 400 response, just "Error processing request." in the response text.

The server logs are not providing more info:

Code:
[2023-12-12 10:16:23.299 -03:00] [ERR] Error processing request. URL "POST" "/Items/664d7ffdf0922c7eee0ea4f611481ae4".
System.ArgumentNullException: Value cannot be null. (Parameter 'source')

(I couldn't find a "source" in that endpoint parameters)

Any clue what's going on? Thanks!


RE: Change Item's Name using the API - tmsrxzar - 2023-12-12

my solution to such issues is using the developer panel on the browser then inspect the calls when i do it manually then duplicate into my own code, i am honestly not even sure where the api documentation is
give it a try, it's best recommendation i can give