-
Notifications
You must be signed in to change notification settings - Fork 32
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
Slaves not being removed from DB (I am guessing - in presence of Imperial slaves) #25
Comments
Yay. I'll look into it. |
So, the problem is, the plugin doesn't remove no longer existing items from the DB. I just hadn't implemented it. I /think/ I have a solution, but I haven't tested it yet and I don't really have the time to do so right now. I'm uploading it to the dev branch now, in case you want to test it. I'll push it to main once we know for sure it works. |
Other than that odd one I found, it's likely somewhat difficult to find test cases (or we would have found this before). Is it reasonable to add "bogus" commodities to a given station by adding fake, but valid lines to the DB and then see if the plugin removes it? |
Do an update, remove some entries from one or more of the stations in the source file and save it. Do a second update with the force option, see if the entries you removed from the source file are gone in the DB. The code I added, assuming no bugs or unintended results, does the following: Set current station to -1, create empty dict. For each item in the source file: Check if current station matches item's station. (Will be false for the first item.) If not, delete all items in the current dict set to false, delete the dict, set current station to the new station, and create a dict of all the possible items set to false If so, set the current item to true in the dict. |
Fixed in 8a43404 |
See the following excerpt from my TradeDangerous.prices. There are no slaves presently for sale at this station (HR 8208/Sturgeon Station)
My best guess is that because "Slaves" is a subset of "Imperial Slaves" it did not get deleted when the new station data was uploaded, you can see the disparity of date/time information.
The text was updated successfully, but these errors were encountered: