Skip to content

Commit

Permalink
fix: check for existence of the DB itself
Browse files Browse the repository at this point in the history
The plugins don't export the prices cache anymore, so that's a bad thing
to check for to determine if the DB needs to be built.

Do the smart thing and check for the existence of the actual DB file
itself.
  • Loading branch information
eyeonus committed Apr 24, 2024
1 parent b6a6237 commit 3dee4cb
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion tradedangerous/plugins/eddblink_plug.py
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ def run(self):

# We can probably safely assume that the plugin has never been run if
# the prices file doesn't exist, since the plugin always generates it.
if not (self.tdb.dataPath / Path("TradeDangerous.prices")).exists():
if not (self.tdb.dataPath / Path("TradeDangerous.db")).exists():
self.options["clean"] = True

if self.getOption("clean"):
Expand Down
2 changes: 1 addition & 1 deletion tradedangerous/plugins/spansh_plug.py
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ def __init__(self, *args, **kwargs):
assert not (self.url and self.file), 'Provide either url or file, not both'
if self.file and (self.file != '-'):
self.file = (Path(self.tdenv.cwDir, self.file)).resolve()
if not Path(self.tdb.dataPath, "TradeDangerous.prices").exists():
if not Path(self.tdb.dataPath, "TradeDangerous.db").exists():
ri_path = Path(self.tdb.dataPath, "RareItem.csv")
rib_path = ri_path.with_suffix(".tmp")
if ri_path.exists():
Expand Down

0 comments on commit 3dee4cb

Please sign in to comment.