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

handle no path for id #140

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

handle no path for id #140

wants to merge 2 commits into from

Conversation

djay
Copy link
Collaborator

@djay djay commented Sep 12, 2022

No description provided.

@drinfernoo
Copy link
Owner

drinfernoo commented Sep 12, 2022

@djay Kind of a weird way to do it, but I was on the move... I pushed a change that lets us not run manage.get_path_by_id twice in the success case. If you think that looks ok, we can merge this one, and I'll push a version bump.

EDIT: Looking a tiny bit closer, in this instance, we call into this bit of code:

def find_defined_paths(group_id=None):
if group_id:
filename = "{}.group".format(group_id)
path = os.path.join(_addon_data, filename)
group_def = utils.read_json(path)
if group_def:
return group_def.get("paths", [])
else:
return []

That doesn't look particularly performance heavy, but it may still be a good idea to try and spare calls to it, since it is reading from disk.

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