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

Repair Date Since #616

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Repair Date Since
Check if file has correct date
  • Loading branch information
sissiwup authored Aug 19, 2022
commit 7d3e785ae66de412053c459787e76a4ee90cfff8
13 changes: 10 additions & 3 deletions blinkpy/blinkpy.py
Original file line number Diff line number Diff line change
Expand Up @@ -338,9 +338,10 @@ def download_videos(
_LOGGER.info("No videos found on page %s. Exiting.", page)
break

self._parse_downloaded_items(result, camera, path, delay, debug)
self._parse_downloaded_items(
result, camera, path, delay, debug, formatted_date)
Copy link
Owner

Choose a reason for hiding this comment

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

Where in the download_videos method is formatted_date set?

Copy link
Author

Choose a reason for hiding this comment

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

I dont see the problem. It works fine.


def _parse_downloaded_items(self, result, camera, path, delay, debug):
def _parse_downloaded_items(self, result, camera, path, delay, debug, formatted_date):
"""Parse downloaded videos."""
for item in result:
try:
Expand All @@ -357,9 +358,15 @@ def _parse_downloaded_items(self, result, camera, path, delay, debug):
continue

if is_deleted:
_LOGGER.debug("%s: %s is marked as deleted.", camera_name, address)
_LOGGER.debug("%s: %s is marked as deleted.",
camera_name, address)
continue

if created_at < formatted_date:
Copy link
Owner

Choose a reason for hiding this comment

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

What type is formated_date? Is it the same as created_at? How do you ensure that?

Copy link
Author

Choose a reason for hiding this comment

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

I think it will work implicite. It works as string also.

_LOGGER.debug("%s: %s is marked to old.",
camera_name, address)
continue

clip_address = f"{self.urls.base_url}{address}"
filename = f"{camera_name}-{created_at}"
filename = f"{slugify(filename)}.mp4"
Expand Down