-
Notifications
You must be signed in to change notification settings - Fork 184
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
Remove duplicate upload code #773
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This output isn't needed - if there's an error the name of the file with the lftp commands will be output. If lftp was successful user's won't care about that file.
This code was moved from endOfNight.sh here. It should have been in generateForDay.sh as well, but was accidently never added there, but it doesn't matter since it's now centralized in upload.sh.
Keogram, startrails, and timelapse all had almost identical code to create them and to upload them - they all used the same logic. This commit moves that logic into "generate" and "upload" functions, resulting in a smaller file with no duplicate code. NOTE: when looking at the changes in this commit, Git does a poor job - it compares the two new functions to the old keogram code, and there are a bunch of differences. It doesn't seem to notice that the two functions are new. If you look at the startrails and timelapse differences it'll be much clearer.
minor change to not use the name "endOfNight_additionalSteps.sh" twice, which slightly improves maintenance if we ever decide to change that file name.
Renamed TIMELAPSE_PARAMETERS and added STARTRAILS_EXTRA_PARAMETERS so they are all consistent.
Add --silent2 to not display the final "If you want to upload..." message, which shouldn't appear when called via endOfNight.sh. Made a couple minor other changes.
Ended up not needing it, and didn't know how to delete the commit that added it.
No need to check for 0-length files since the saveImage*.sh scripts already did. Keogram and startrails scripts don't say how many files they are processing, so timelapse shouldn't either. We don't mention other settings so no need to mention "scale" setting. Keogram and startrails scripts don't say say files were created, so timelapse shouldn't either.
The name changed in config.sh.repo. For compatibility, leave the old name in, but delete after 0.8.5.
Moved the "Nasty JQ trick" from endOfNight.sh to generateForDay.sh since that's where the keogram and startrails files are now created.
endOfNight.sh and generateForDay.sh did the same thing for keogram, startrails, and timelapse files, so the code to create and upload those file was moved to generateForDay.sh. As such, endOfNight.sh is much shorter and there is no longer duplicated code, making maintenance easier. Further, generateForDay.sh consolidated much of the code into a couple internal functions.
linuxkidd
approved these changes
Nov 10, 2021
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Merged the upload code from endOfNight.sh into generateForDay.sh since they were doing almost identical things.
Consolidated code in generateForDay.sh into a couple internal functions to further reduce redundancy.
Other consistency and simplification changes.