Request to sort deck search results by price

 avatar
adamdroid avataradamdroid
{"ops":[{"insert":"As title suggests.\n"}]}
0
 avatar
{"ops":[{"insert":"Unfortunately sorting decks by price isn't really possible currently. The reason for this is that currently the only way to get the price of the deck is to query out all the cards in the deck, then sum up the prices. Easy enough to do with a single deck. However, doing that with every single deck in a list request (aka a search) isn't possible.\n\nWe could cache the sum total of a deck, and use that to search. But then a whole new problem arises of deck prices going stale if no cards are changed, etc. And the only way to keep them up to date would be to go through every deck on the site and calculate the sum total and cache it. Doing so would likely take too long to do regularly. \n\nSorry for the less than stellar news. But this is why price sort has never been a thing, and likely won't be unless we can come up with a technical solution to the aforementioned issues. \n"}]}
0
 avatar
adamdroid avataradamdroid
{"ops":[{"insert":"So I don't know how you maintain your card pricing, if it's dynamic on page load, cached until a certain expiry, or drawing from your own DB of cards that is then updated frequently.\n\nBut here are some thoughts on working around the difficulties mentioned.\n\nIf not the last option, it might be something to consider. It might make other things easier.\n\nSumming could be done on initial search results on decks that have been updated within a certain time period, such as a month. Other older decks could potentially be included based on other criteria such as stricter relevance to search terms, view count, etc. Then, a hard limit to how many to include based on your resources could be set as well as a grace period before the same deck gets summed again.\n\nSo the initial search would be sorted however, with said eligible decks getting and updated value sum. So then when switched to sort by sum, decks with a sum value less than XX days old would be shown and sorted.\n\nThis would just be in addition to decks that have recent sums just from being opened in the deck editor or appearing in results.\n\nThis would no doubt exclude a lot of valid search results, but perhaps enough to provide what people sorting by price are looking for.\n\nAs a suggestion, I would not include basic lands in the sum cost for best utility, and if even possible, use the version of the card with the lowest price (I realize that might entail a lot of work). To aid in the latter, there might be a default setting for deck building that always adds the cheapest version of a card.\n"}]}
0
Support us on Patreon to remove ads