-
-
Notifications
You must be signed in to change notification settings - Fork 173
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feat: add option to prioritize drops ending soonest #433
Conversation
Hello o/ Interesting. I'm lost on it's function though. First of all, there's no need to sort campaigns with their Lines 1652 to 1654 in d7c2c8d
Upcoming campaigns are sorted by their The same campaigns order is then used to fetch the relevant channels for each campaign to progress, but since campaigns and channels aren't tied with each other, the order gets lost. If the order would be somehow preserved, the miner would always pick the very first channel to watch, as it'd have a game of the highest priority, and if no priority would be present (priority of 0), then the sorting by Also, I can see this code actually modifies the priorities. How exactly is the priority list order kept in place and it prioritizes campaigns that's going to end soon? |
Priority list is considered second to time ending soonest. This is intentional. Once the priority list is finished, then it does the same for non-priority games. Of course, this is only if the user wants this since it's a toggleable setting. |
So essentially, when toggled on, it ignores the order on the priority list, but works only off the campaign's end date? I mean, this was never the purpose of the priority list in the first place, and "priority" in the priority list stops making sense at that point. But I kinda like the idea a bit. I'll need to think about this for a while. This isn't something that I can merge right away, but I'm not saying no to it. Could be something for #220 as well. |
It doesn't fully ignore the priority list though. It still works on those games before any games not in the priority list.
Just to be clear, it doesn't affect how the system works right now unless it's enabled by the users. |
I actually thought that this was how the priority list worked - I didn't realize that the order listed in the priority list was the order the program would prioritize them in. I always assumed the system would prioritize in something like "If a priority campaign exists (regardless of location on the list), prioritize it over campaigns not on the list at all. Then, pick the one ending soonest that we can still get drops from." |
Even better would be an algorithm maximizing the count of possible drops - like, make sure that few shorter are completed instead of one longer. |
@jaredkotoff If you are willing to adapt this code to my new fixed fork, I would be willing to include it in that. Please only take the part, that prioritises end time, because as DevilXD said, the rest is redundant. |
@Windows200000 i already have this code merged into a different fork, I was just trying to contribute back upstream |
@jaredkotoff but it's broken now and DevilXD doesn't have the time to work on it, so I'm maintaining it in a fork for now. I'm still not familiar with that part of the codebase, which is why it would make sense if you took the end-date priority and made a pull request in my fork, that works right now. Only if you want to, or if you were gonna adapt it for yourself anyways, of course. |
@jaredkotoff Twitch changed the API recently and there is now no progress with code from the main repo. DevilXD expressed, that he would like to rewrite a big part sometime in the future anyways, but he doesn't have time now. And I personally don't like working with python. If it was me I would make it in rust, work a lot more with defined variables, rather than hardcoded integers, compartmentalize a lot more, and have an SQLite db that allows simple access and use of all necessary data about streams and drops. But since my fork works, I have no motivation to write it entitely from scratch. |
@Windows200000 I understand what you are saying. The other fork I use already pulled in your changes, as well as several features I've already contributed. |
@jaredkotoff would've moved it elsewhere, but you don't have issues on your fork The comparison is interesting. The "starting" message is kinda pointless, because there is no terminal it could get printed to and I can't implement headless, because despite me having to leave my whole PC running, DevilXD is (rightfully) worried about people using that to make money/spam twitch. I will look into the ending priority tho, I hope nothing collides with the dark mode I just added. |
@jaredkotoff Oh you have 2 accounts, that confused me xD, is there a reason you don't have this priority in your main fork? |
@Windows200000 I don't have two accounts. I have an GitHub org I sometimes work under. If you're looking for this sorting code, this PR has the extracted and relevant code. For some additional clarification, check the network graph: https://github.com/DevilXD/TwitchDropsMiner/network |
Also, It might be a worthwhile venture to implement your own solution. |
@jaredkotoff I don't see a good reason to add the unlinked stuff, so I think I will stick to this. I think that would just confuse people, it's not like you get anything without linking anyways. |
@Windows200000 there is no unlinked stuff in this PR or fork.
You do. You get the drops. |
@jaredkotoff But they can't get added to your game account without linking, or am I missing something? I mean you can link later, but there is no reason not to link right away if you want them. |
@Windows200000 You are missing how time works... You can buy furniture for a house that you will move into someday, you don't have to own the house first and miss out on a good sale. Either way, this is irrelevant to this PR. No one bought up the unlinked stuff before, nor was I suggesting adding that to this or your repo. |
Going to rework this code |
Personally, been using this for months and thought others might appreciate it.
This maximizes the amount of potential drops by focusing on drops ending soonest.
It still takes into account user's priority list and mines those drops first before moving onto any drops that aren't prioritized.
Note: the priority list's order doesnt matter when this setting is turned on
See that Halo's campaign is mining first because these campaigns are often very short so this is top priority to mine before it ends. You can see that Rainbow Six Siege will be mined next as its campaigns ends after Halo's. We will mine this campaign so we don't miss it by mining something else.
I hardly miss any drops from games in my Priority list this way because we focus on mining games that will end soon rather than mining a game that we might have a whole month to get too.