jadedtdt / MusicBot

Improvements to the vanilla MusicBot - Most notable features include an advanced AutoPlaylist, metadata tags on songs, and all hosted for < 1$/mo on AWS
2 stars 0 forks source link

priority queue or dict? #53

Open jadedtdt opened 6 years ago

jadedtdt commented 6 years ago

key: user obj/id val: num songs

this would be useful when searching through a song. we can search in hierarchical fashion starting with people who have fewer songs and stopping at the person with the most songs. This doesn't really help if the same people executing these commands are the people with the most commands, which is likely.

If that's the case, a LRU cache might be good, where there are x number of allowed total songs and if the sum of the users' songs surpass the limit, the user to execute a command the longest time ago is booted off. I actually like this one the most c:

jadedtdt commented 6 years ago

https://github.com/jadedtdt/MusicBot/commit/55bcc1bff170add60c68fe962271ee2a92033bb4

added a dict of url -> song. not what was posed but was still a code improvement