Moonmode label parameters#2881
Open
tswfi wants to merge 5 commits into
Open
Conversation
This file contains hidden or 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
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.
Instead of always appending the moonmode and eclipse modes at the end of the template add new placeholders for them.
New template variables:
{moonmode}: On/Off, just like stretch{moonmode_label}: empty or* Moon Mode *just like the current implementation injected{moonmode_none}: always empty, nice way to supress the message{eclipse}:No/Lunar/Solar{eclipse_label}: empty* LUNAR ECLIPSE *or* SOLAR ECLIPSE *{eclipse_none}: always empty, supresses the message{modes}: the same thing that was automatically injected but now it can be put anywhere{modes_none}: always empty, supresses modes from the template completelyIf tempalate does not contain any of those this works just like before. If those are found from the template they will not be added automatically and instead just the new variable is rendered.
get_image_label was refactored a bit to get the moonmode and eclipse be nicely in their own places. Also dried up adding adsb, satellite and extra_file data to the template (they all did the same thing so just loop them)
Some minor tweaks:
LUNAR_ECLIPSE_MAX_SUN_MOON_SEPandSOLAR_ECLIPSE_MIN_SUN_MOON_SEPjust to get rid of two magic numbersThis issue #2350 was the inspiration to take a look at this.
I wasn't able to test all of these (I have no adsb data configured)... Would love to see a test suite for everything but that is kinda daunting task...