Jump to content

Patch Channel Number/ChannelNumber via API


Recommended Posts

anthonws
Posted (edited)

Hello,

Looking into Swagger UI, there doesn't seem to exist a way to programmatically patch the Number or ChannelNumber for LiveTV Channels.

Is this correct? If not, can anyone point me in the right direction?

Also, what would be the correct API endpoint to update the channel logo?

Thanks!

anthonws

Edited by anthonws
Posted

Hi, I would use the chrome debugger to look at what the metadata editor is doing in the beta server.

  • Like 1
anthonws
Posted (edited)

Hi @Luke,

That is what I did in the meantime. But I'm not sure how to POST the info.
Here is a test.
Would this JSON payload be enough to change (in this case remove) the ChannelNumber?

## Request JSON Payload
## {"Id":"341475","Name":"RTP 1","ChannelNumber":"","OriginalTitle":"","ForcedSortName":"","CommunityRating":"","CriticRating":"","IndexNumber":null,"AirsBeforeSeasonNumber":"","AirsAfterSeasonNumber":"","AirsBeforeEpisodeNumber":"","ParentIndexNumber":null,"SortParentIndexNumber":"","SortIndexNumber":"","DisplayOrder":"","Album":"","AlbumArtists":[],"ArtistItems":[],"Overview":"","Status":"","Genres":[],"Tags":[],"TagItems":[],"Studios":[],"PremiereDate":null,"DateCreated":"2021-05-11T23:00:00.000Z","EndDate":null,"ProductionYear":"","Video3DFormat":"","OfficialRating":"","CustomRating":"","LockData":false,"LockedFields":["ChannelNumber"],"ProviderIds":{"ExternalServiceId":"Emby"},"PreferredMetadataLanguage":"","PreferredMetadataCountryCode":"","Taglines":[]}

Id = "341353"
Name = "RTP 1"
json_obj = '{{"Id":"{0}","Name":"RPT 1","ChannelNumber":""}}'.format(Id)

URL_POST = "http://192.168.25.9:8096/emby/Items?Ids={0}&api_key=8d84533ba00d4b62819f1cfca61e6cc5".format(Id)

 

Edited by anthonws
Posted

I would compare to the post sent by the web app and then adjust yours to match.

  • Like 1
anthonws
Posted (edited)

@Luke

It was this that I saw as the RAW Data being sent by the POST:

{"Id":"341475","Name":"RTP 1","ChannelNumber":"","OriginalTitle":"","ForcedSortName":"","CommunityRating":"","CriticRating":"","IndexNumber":null,"AirsBeforeSeasonNumber":"","AirsAfterSeasonNumber":"","AirsBeforeEpisodeNumber":"","ParentIndexNumber":null,"SortParentIndexNumber":"","SortIndexNumber":"","DisplayOrder":"","Album":"","AlbumArtists":[],"ArtistItems":[],"Overview":"","Status":"","Genres":[],"Tags":[],"TagItems":[],"Studios":[],"PremiereDate":null,"DateCreated":"2021-05-11T23:00:00.000Z","EndDate":null,"ProductionYear":"","Video3DFormat":"","OfficialRating":"","CustomRating":"","LockData":false,"LockedFields":["ChannelNumber"],"ProviderIds":{"ExternalServiceId":"Emby"},"PreferredMetadataLanguage":"","PreferredMetadataCountryCode":"","Taglines":[]}

The URL was:

http://192.168.25.9:8096/emby/Items/341364?X-Emby-Client=Emby%20Web&X-Emby-Device-Name=Firefox&X-Emby-Device-Id=<DEVICEID>&X-Emby-Client-Version=4.6.0.46&X-Emby-Token=<TOKEN>

Hence why I am trying with:

"http://192.168.25.9:8096/emby/Items?Ids={0}&api_key=<API KEY HERE>

And posting this JSON data payload:

json_obj = '{{"Id":"{0}","Name":"RPT 1","ChannelNumber":""}}'.format(Id)

Thanks!!!

EDIT:

But I am getting a 404, "Unable to find the specified file"  :S

Edited by anthonws

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...