ecleese / plexWatchWeb

A web front-end for plexWatch.
254 stars 41 forks source link

Sync Status for shared users #71

Open ecleese opened 10 years ago

ecleese commented 10 years ago

raw xml located in: https://plex.tv/servers//sync_lists?auth_token=

Arcanemagus commented 9 years ago

Quoting @drzoidberg33:

The sync thing is a bit of a bitch. You can easily get the sync lists from plex.tv/servers/yourmachineid/sync_lists but it doesn't include the username, only a user_id. If you want username then you need to pull the friends list first as well as your own account data (as your own user_id is referenced as 1 locally). So essentially you need to make 4 different calls (machine_id, sync_list, friends, account) to get a useful sync list.

drzoidberg33 commented 9 years ago

@Arcanemagus @ecleese

The best solution for PlexPy was to write this stuff to a local db and reference it like that, otherwise the api calls take too long.

I store the machine_id in my config file and store a users table in my database which includes both friends and the own users account details. The user table is updated periodically (default every 12 hours).

This way I make one call to the sync list api and just call the usernames from my db. If a username has not yet been added to my local table it will just show as blank.