justusbot/data/daily/rotation/.keep

23 lines
No EOL
2.8 KiB
Text

The scripture rotation works as follows:
1) Base scriptural references are stored in "./s" which is the "source" directory. These follow the format of <BOOK_ID>_<CHAPTER>:<VERSE_SPEC> where VERSE_SPEC is either a single integer or a span of verses delineated by "-" between two separate integer values, e.g. "gen_1:1" or "jhn_1:1-4".
In the case of books that only contain a single chapter, CHAPTER is replaced by VERSE_SPEC.
2) The "./c" directory contains the currently selected scripture. This will be cycled out by a cron event at a set time once daily. The current scripture is a symlink to the source.
3) As scripture is selected, a new directory under "./r" will be created as an integer representing the count of each citation's use. For example, if a passage is selected twice, it will be symlinked under "./r/2". As passages are moved into each counter group, passages that have no count (are only present under "./s") or are in a lower counter group than other passages will be given priority in the rotation until all passages have been added to the highest counter group.
4) User-submitted passages will be added under "./daily/user/<base64_username>" where their username is encoded using base64. These passages will then be symlinked into "./daily/rotation/u" where the first user to submit a passage will be the one credited with its inclusion. (However, the passage will still be stored under that user's name, even if they've submitted a duplicate, allowing for some credit to be given to them as well if the scripture store is queried.)
5) User-submitted passages will take priority over the "source" store and will follow the same general assignment as "2" and "3."
6) User-submitted passages that duplicate those in the "source" store won't be counted twice, but they will be prioritized as in "5." They will be handled as if they are not present in the "source" store.
7) User-submitted passage priority will work by attempting to first exhaust all user-submitted passages first, in accordance with "3," until no further user-submitted passages remain. When that occurs, the "source" store will be consulted (minus replicas) until all passages (user and "source") have been promoted to the same rotation counter group.
8) As more passages are submitted by users, those will be examined first as in "7" until they are exhausted.
9) In order to avoid newly-submitted passages from being repeated until they are promoted to the highest counter group, once a counter group has been exhausted any un-grouped passages will be promoted to the lowest-numbered counter group.
For example, if all passages currently present in the rotation have been used at least 4 times, leaving them all in the "./r/4" counter group, any newly-submitted user passages will be promoted to the "./r/4" counter group instead of generating a new "./r/1" group.