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

Adde from_date and to_date options to limit the processed files #202

Merged
merged 3 commits into from
Nov 13, 2023

Conversation

emdioh
Copy link
Contributor

@emdioh emdioh commented May 25, 2023

This PR adds from_date and to_date command line options to limit the file processing based on the calculated data. Files with unknown date are unfiltered.

This is useful to me because I have a sync folder where the phones keep dumping the data so deleted pictures will be recreated.
I use phockup to copy the pics to a nice structure and then select the ones that I want to keep, so reprocessing all the source folder would replace the photos that I deleted.

phockup.py Outdated
@@ -296,6 +296,28 @@ def parse_args(args=sys.argv[1:]):
files by an additional level after sorting by date.
"""
)

parser.add_argument(
'--from_date',
Copy link
Owner

Choose a reason for hiding this comment

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

Please replace _ with -

phockup.py Outdated
)

parser.add_argument(
'--to_date',
Copy link
Owner

Choose a reason for hiding this comment

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

Please replace _ with -

src/phockup.py Outdated
if type(file_date) is dict:
file_date = file_date["date"]
if self.from_date is not None and file_date < self.from_date:
progress = f"{progress} => {filename} skipped: date {file_date} is older than from_date {self.from_date}"
Copy link
Owner

Choose a reason for hiding this comment

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

Please replace _ with - for option name and maybe add -- to the option name (--from-date)

@ivandokov ivandokov merged commit 3f85d38 into ivandokov:master Nov 13, 2023
6 of 7 checks passed
unapproachable pushed a commit to unapproachable/phockup that referenced this pull request Sep 23, 2024
…dokov#202)

* Added from_date and to_date options to limit the processed files

* Removed a leftover debug print

* Added info for this feature in the readme. Replaced "_" with "-" in the arguments names

---------

Co-authored-by: Marco Dondero <[email protected]>
Co-authored-by: Ivan Dokov <[email protected]>
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