Skip to content

Conversation

@Julian-O
Copy link
Contributor

@Julian-O Julian-O commented Jan 8, 2026

This is actually two unrelated changes which accidentally got mixed into one branch, but they are simple enough I think I might just get away with it! (Sorry.)

  1. When a table is generated, it used to print a count of the records as, for example, "100 photos". However, the table wasn't always of photos. In the Readme was an example - a table of cameras used. This fix generalised the text from "photos" to "records".

  2. Having more than bare minimum code in __init__.py isn't wrong, but it is "code smell". (Zen of Python: Explicit is better than implicit.) I moved as much as was convenient out of that file and into the places it was needed. I also changed from BASE to EPOCH which I think is a more apt technical term.

Mostly trivial changes that have no effect on running code, such as:
* Removing redundant brackets.
* Making implicit "return None" explicit
* Making names follow PEP8 rules
* Corrections to comments

In gps.py, a large chunk of unused code was removed.

The only change that should affect any behaviour was in display.py. smart_unit didn't cover the case where no prefix was required. (Presumably never noticed because no photo less than 1KB has been encountered.)
…os (e.g. a list of cameras).

Also grammar correction: on -> of.
Copy link
Owner

@fdenivac fdenivac left a comment

Choose a reason for hiding this comment

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

Ok of course, regarding the correction of the results header and the renaming of the constants (LIGHTROOM_EPOCH, TIMESTAMP_LR_EPOCH).

However, after further consideration, I prefer to keep these constants at the module level (init.py), or even in lrcat.py (the central element).
Indeed, these are general Lightroom constants, and scripts can use them.
This is actually the case in my archiving script based on file timestamps, where it's necessary to use TIMESTAMP_LR_EPOCH.
Importing this constant from lrsmarcoll.py doesn't make sense for a script unrelated to smart collections.
What do you think?

Copy link
Owner

@fdenivac fdenivac left a comment

Choose a reason for hiding this comment

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

Finally, I'll keep TIMESTAMP_LR_EPOCH, but moved in lrcat.py

@fdenivac fdenivac merged commit 675922e into fdenivac:master Jan 9, 2026
1 check passed
@Julian-O
Copy link
Contributor Author

Sorry for the delay in responding.

This whole issue isn't a hill I think it is worth dying on. It is barely a hill worth climbing.

If I was writing it myself, from scratch, today, I would probably have a timedefs.py file and put these constants in there.
I'd also probably calculate TIMESTAMP_LR_EPOCH rather than having a magic number.

But none of this is worth changing. I am happy with your suggestions. Thanks.

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