Skip to content

Conversation

@Megabytemb
Copy link
Contributor

This adds abstractions and the adjust volume endpoint

def safeget(dct, *keys, default=None):
"""Get a recursuive object from a dict."""
for key in keys:
try:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not use dict.get?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't use get, otherwise we end up with .get(...).get(...).get(....) and it can get quite long and messy.

This little helper function cleans that up.
If you're happy with it, in a later pull request, i can update all the others to use the helper function.

@alandtse
Copy link
Collaborator

Just to confirm, did you still want to do this?

@Megabytemb Megabytemb force-pushed the add-media-controls branch from 65ca349 to cdcd5d9 Compare June 12, 2023 04:29
@alandtse
Copy link
Collaborator

Btw, I'm not sure why this touches every file in the repo. This will really muddle history. Can you figure out why?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants