Skip to content

Commit

Permalink
Pass correct DB path for get_user_observations()
Browse files Browse the repository at this point in the history
  • Loading branch information
JWCook committed May 30, 2023
1 parent 4a7a6e0 commit 4d07f3a
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
4 changes: 2 additions & 2 deletions naturtag/app/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -242,9 +242,9 @@ def main():
app = QApplication(sys.argv)
splash = QSplashScreen(QPixmap(str(APP_LOGO)).scaledToHeight(512))
splash.show()
settings = Settings.read()

app.setWindowIcon(QIcon(QPixmap(str(APP_ICON))))

settings = Settings.read()
set_theme(dark_mode=settings.dark_mode)
window = MainWindow(settings)
window.show()
Expand Down
4 changes: 3 additions & 1 deletion naturtag/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,9 @@ def get_user_observations(
return new_observations[:limit]

# Get up to `limit` most recent saved observations
obs = get_db_observations(username=username, limit=limit, order_by_date=True)
obs = get_db_observations(
self.client.db_path, username=username, limit=limit, order_by_date=True
)
return list(obs)


Expand Down
2 changes: 1 addition & 1 deletion naturtag/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ class Settings(YamlMixin):
def read(cls, path: Path = CONFIG_PATH) -> 'Settings':
return super(Settings, cls).read(path) # type: ignore

# Shortcuts for application files within the user data dir
@property
def data_dir(self) -> Path:
return self.path.parent # type: ignore
Expand Down Expand Up @@ -186,7 +187,6 @@ def start_image_dir(self) -> Path:
else:
return self.default_image_dir

# Shortcuts for application files within the
def set_obs_checkpoint(self):
self.last_obs_check = datetime.utcnow().replace(microsecond=0)
self.write()
Expand Down

0 comments on commit 4d07f3a

Please sign in to comment.