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

Camera widget cannot get most recent timelapse image if custom path is defined #1072

Closed
kimbernator opened this issue Aug 18, 2021 · 5 comments

Comments

@kimbernator
Copy link

kimbernator commented Aug 18, 2021

Describe the problem/bug

I have a camera defined with a custom timelapse path. When I configure a camera widget on my dashboard and select "most recent timelapse image", it will never find a valid one because it doesn't flex on the custom path.

The logic in routes_general.camera_img_latest_timelapse() is hardcoded to search for the filename successfully found by utils_general.get_camera_image_info() within "INSTALL_DIRECTORY/cameras/{camera_uid}".

Versions:

  • Mycodo Version: 8.11.0
  • Raspberry Pi Version: 4
  • Raspbian OS Version: buster

Reproducibility

Please list specific setup details that are involved and the steps to reproduce the behavior:

  1. Create camera via More->Camera
  2. Set the timelapse path for the camera to any valid path on the system
  3. Create a "Camera" widget on a dashboard that refers to the new camera
  4. For "Image Display Type", select "Display Latest Timestamp Image"

Expected behavior

The most recent timelapse image would show in the widget

@kizniche
Copy link
Owner

Thanks for the bug report. I'll prepare fixes that will be available in the next release.

@kizniche kizniche added the bug label Aug 18, 2021
@kizniche
Copy link
Owner

Actually, this was suposedly fixed with cca16f6#diff-6d1d7d9a1ecfaec5100bf049d2ac42413e199e7d979151a31f649510c1afce94

Neither the current release nor master branch has "INSTALL_DIRECTORY/cameras/{camera_uid}" in utils_general.get_camera_image_info().

This appears to be an issue with camera_img_latest_timelapse() in routes_general.py:

camera_path = assure_path_exists(
os.path.join(PATH_CAMERAS, '{uid}/timelapse'.format(
uid=camera_unique_id)))

@kizniche
Copy link
Owner

It's a bit more involved that that, I'm finding, but I'll have it solved soon enough.

kizniche added a commit that referenced this issue Aug 19, 2021
… widget resizing, fix email logging showing actual subject
@kizniche
Copy link
Owner

Just committed a fix. Thanks again for the bug report.

@kimbernator
Copy link
Author

kimbernator commented Aug 19, 2021

Thank you for the quick fix!

And yes, my mistake for specifying that it was hardcoded to that path when I was making reference to os.path.join(PATH_CAMERAS, '{uid}/timelapse'.format uid=camera_unique_id))) - I could have probably specified something a little more searchable.

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

No branches or pull requests

2 participants