Skip to content

Rework playlist loop detection, validate against loops when adding playlist via API - #1162

Open
Toastbrot236 wants to merge 17 commits into
LittleBigRefresh:mainfrom
Toastbrot236:pl-loop-fix
Open

Toastbrot236 wants to merge 17 commits into
LittleBigRefresh:mainfrom
Toastbrot236:pl-loop-fix

Conversation

@Toastbrot236

Copy link
Copy Markdown
Contributor

Refactors and rewrites the way loops in playlists get detected (primarily by iteratively looking for the parent playlist in the child playlist's sub-playlist tree), makes the game endpoint only add the playlist after failing to find loops, instead of adding first and then immediately removing when it does find a loop, and also makes the playlist addition API endpoint use this loop detection method aswell, since I forgot to validate against that when initially writing the API endpoints.

Is missing unit and real tests currently. Also, some comments and parameter namings may still be weird or unfitting.

@Toastbrot236

Copy link
Copy Markdown
Contributor Author

Seems to work for the LBP1 endpoint (tested using the actual game), so it'll likely also work for the API endpoint. Still need unit tests for this though. Also, I bumped a related rate-limit bucket's max requests up because turns out, LBP1's playlist caching isn't that good.

@Toastbrot236

Copy link
Copy Markdown
Contributor Author

I've now added unit tests for both adding a playlist to playlist via LBP1, and via API, should be enough for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant