Closed drikusroor closed 2 months ago
The issue of point 4. seems to be here, in the section_from_any_song
method:
On line 152, it queries sections using the song ids. There is only one song, as the OR and CH sections are seen as the same song - they have the same artist and song name. However, it then selects a section based on the song id randomly (random.choice
). As both sections (with group or
& ch
) are connected to the same song, it randomly selects one of those sections.
Now, I tried to also add the filter_by
parameter to that same query:
def section_from_any_song(self, filter_by={}):
"""Get a random section with a Dutch IP check.
To ensure appropriate IP restrictions, most rules should use this
method instead of operating on the playlist directly.
"""
pks = self.filter_songs(filter_by)
if pks:
# Return a random section
sections = self.playlist.section_set.filter(
song_id=random.choice(pks)
).filter(
**filter_by
)
return random.choice(sections)
And that works for a couple of times, but sometimes it cannot find anything and the whole next_round
method crashes... UPDATE: I incorrectly configured TH5K - Tempo with 10 rounds instead of 5, so in round 6 it tried to look for unused songs (which obviously don't exist anymore).
I'll close this issue as #1113 has fixed point 4. and point 5. was working on ACC already and has been fixed on TST by updating directory permissions.
Description
/toontjehoger
instead of the collection (which on TST has the route/collection/thkids
). NB: I see that the link should be configured correctly already for Kids, and it seems the adult TH1 is being used in the collection on TST. UPDATE: Fixed by configuring the THK1 - Mozart rules.Screenshots
Reproduction URL
https://tst.amsterdammusiclab.nl/toontje-hoger-1-mozart?participant_id=test)
Reproduction steps
Logs
No response
Browsers
No response
OS
No response
Additional context
No response