Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change "Home Screen" settings #1

Open
seansusmilch opened this issue May 14, 2020 · 0 comments
Open

Change "Home Screen" settings #1

seansusmilch opened this issue May 14, 2020 · 0 comments
Labels
help wanted Extra attention is needed

Comments

@seansusmilch
Copy link
Owner

I'd like to change the "Home Screen" settings like the ones in this screenshot

I keep getting errors like "Index was outside the bounds of the array." when trying to use requests. Heres my code

# # change display prefs
device = {
    'X-Emby-Client': "Requests Python",
    'X-Emby-Device-Name': "Python",
    "X-Emby-Client-Version": "4.4.2.0",
    "X-Emby-Device-Id": "12345678-1234-1234-1234-123456789012"
}
raw_data = {
    "username": newname,
    "Pw": newpw
}
raw_data.update(device)
res = requests.post(base_url+'/Users/AuthenticateByName', params=raw_data, headers=headers)
data = json.loads(res.text)
temp_token = data['AccessToken']

raw_data = {
    'X-Emby-Token': temp_token,
}

res = requests.get(base_url+'/emby/DisplayPreferences/usersettings?userId='+newId+'client=emby', raw_data, headers=headers)
# print(res.text)
data = json.loads(res.text)
conf_id = data['Id']

raw_data = {
    "X-Emby-Token": temp_token,
    "Id": conf_id,
    # ViewType	string
    # SortBy	string
    # IndexBy	string
    "RememberIndexing": False,
    # PrimaryImageHeight	integer($int32)
    # PrimaryImageWidth	integer($int32)
    "CustomPrefs": {
        "homesection0": "nextup",
        "homesection1": "librarybuttons",
        "homesection2": "latestmedia",
        "homesection3": "resume",
        "homesection4": "none",
        "homesection5": "none",
        "homesection6": "",
        "tvhome": ""
    },
    "ScrollDirection": "Horizontal",
    # ShowBackdrop	boolean
    # RememberSorting	boolean
    "SortOrder": "Ascending",
    # ShowSidebar	boolean
    "Client": "emby",
}
raw_data.update(device)
res = requests.post(base_url+'/emby/DisplayPreferences/usersettings?userId='+newId+'&client=emby', params=raw_data, headers=headers)
print(newname, ' update display prefs ', res.status_code)
print(res.text)
@seansusmilch seansusmilch added the help wanted Extra attention is needed label May 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant