Skip to content

Commit

Permalink
configuration handling bugfixes
Browse files Browse the repository at this point in the history
  • Loading branch information
gogodr committed May 15, 2022
1 parent f0b2b2b commit b2f36d9
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 9 deletions.
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## LostArk Market Watcher 0.7.4
## LostArk Market Watcher 0.7.5
This app listens to the screenshot folder for new files.
Starting on the version 0.3.0 this app needs to be launched through the [Lost Ark Market Launcher](https://github.com/gogodr/LostArk-Market-Launcher)
Each new file is scanned and if the market window is detected in the picture then the image is segmented.
Expand All @@ -24,6 +24,9 @@ In order to contribute to the LostArk Marketplace database, the contributor must
Audio files from [MixKit](https://mixkit.co/)

### Changelog
### 0.7.5
- Bugfix: Configuration handling

### 0.7.4
- Bugfix: soft game detection config set

Expand Down
27 changes: 19 additions & 8 deletions modules/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@


class Config(metaclass=Singleton):
version = "0.7.4"
version = "0.7.5"
region: str
game_region: str
debug = False
Expand Down Expand Up @@ -60,7 +60,7 @@ def load_config(self):
self.volume = float(self._config.get(
"Watcher", "volume"))
else:
self.volume = 1.0
self.volume = 100
changes = True

if self._config.has_option("Watcher", "delete_screenshots"):
Expand Down Expand Up @@ -112,9 +112,20 @@ def load_config(self):
changes = True

self.get_game_region()

if changes:
self.update_config_file()
else:
self.play_audio = True
self.volume = 100
self.delete_screenshots = False
self.save_log = False
self.scan_threads = 2
self.screenshot_threads = 1
self.upload_threads = 2
self.screenshots_directory = None
self.game_directory = find_lostark_directory()
changes = True

if changes:
self.update_config_file()

def update_config_file(self):
if self._config.has_section("Token") == False:
Expand Down Expand Up @@ -157,10 +168,10 @@ def update_config_file(self):
self._config.write(configfile)

def set_or_remove_config_option(self, section, option, value):
if value:
self._config.set(section, option, str(value))
else:
if value is None:
self._config.remove_option(section, option)
else:
self._config.set(section, option, str(value))

def update_token(self, token):
self.id_token = token["id_token"]
Expand Down
1 change: 1 addition & 0 deletions modules/db.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ def refresh_credentials(self):
)
self.last_refresh = datetime.now()
except:
traceback.print_exc()
self.error.emit("Error getting credentials")
self.error.emit(traceback.format_exc)

Expand Down

0 comments on commit b2f36d9

Please sign in to comment.