Client.Platform seems to be broken? Any other workaround?

Hi guys,

Client.Platform seems to not be working to identify which client is accessing the plugin, want to play movies based on client that can handle otherwise do not want to populate the directoryObject with those movies.

As per the unofficial docs here bit.ly/1iHGWQn Client.Platform seems to be broken. Help!

Thanks.

Just tested and working for me. How and where are you using this?

Well, tried using it, so, just tried to write the Client.Platform into the logger to see what comes up. Tried the request.headers as well, based on a post I found here. I know i’m trying to get the headers completely the wrong way. But saw you remove the Client.Platform here and figured it has been removed and gave up 8}

Kept getting “None” in the Logger for Client.Platform

Thanks,

def Start():
...
...
Logger('Platform Client: ' + str(Client.Platform), force=True)
Logger('Platform Client Headers: ' +HTTP.Headers['X-Plex-Client-Identifier'], force=True)

...
...
@route(PREFIX + '/logger')
def Logger(message, force=False):
	if DEV_MODE:
		force = True
	if force:
		Log.Debug(message)
	else:
		pass

You can’t use Client.Platform or any of the Client.xxx inside the Start() function. The Start function is executed when a channel starts. This is usually when Plex Media Server starts. Clients do not access that function. Try using Client.Platform in the function with the @handler decorator or any of the functions that are used when you do something from within the client. That should work.

@constantinople11 said:
But saw you remove the Client.Platform here and figured it has been removed and gave up 8}

I removed those lines in that channel because there is no longer any need for the check for Android. The Android client used to be the only client that could not play multi-part videos, but since 1 or 2 versions ago the Android client can play multi-part video.

@sander1 said:
You can’t use Client.Platform or any of the Client.xxx inside the Start() function. The Start function is executed when a channel starts. This is usually when Plex Media Server starts. Clients do not access that function. Try using Client.Platform in the function with the @handler decorator or any of the functions that are used when you do something from within the client. That should work.

Thank you! Just tried it, it gives something like “Chrome” when using the chrome browser rather that what I was hoping which would be “Plex/Web” but most importantly, it worked, thank you :slight_smile: Appreciate your time.

You can use Client.Product. That’ll give you “Plex Web” in case of web browsers.