Skip to content

Commit

Permalink
Hotfix: fixed error if cache file already exists
Browse files Browse the repository at this point in the history
  • Loading branch information
Luux committed Jan 28, 2021
1 parent 8ea536b commit e4ec119
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion arbsmapdo.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,8 @@ def missing_argument_assistant(self):
self.config["gamemode"] = "Standard"

if self.config.get("beatsaver_cachefile") is None:
self.config["beatsaver_cachefile"] = str(dir_script.joinpath("arbsmapdo_cache.json"))
# FIXME we shouldn't save this as an absolute path in the config as the ARBSMapDo folder might be moved
self.config["beatsaver_cachefile"] = str(dir_script.joinpath("arbsmapdo_cache.json"))

# Here comes everything the assistant will deal with
if self.config.get("download_dir") is None:
Expand Down
4 changes: 2 additions & 2 deletions cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def load_beatsaver_cache_from_andruzzzhka_scrapes(self):
if self.beatsaver_cachefile.is_file() is False:
update = True
else:
last_modified = self.local_cache_path.stat().st_mtime
last_modified = self.beatsaver_cachefile.stat().st_mtime
elapsed = time.time() - last_modified

# Elapsed is given in seconds. The scrapes of andruzzzhka get updated once per day.
Expand All @@ -74,7 +74,7 @@ def load_beatsaver_cache_from_andruzzzhka_scrapes(self):

# def _update_local_cache_file(self):
# print("Saving local cache...")
# with open(self.local_cache_path, "w+") as scrapedcache_fp:
# with open(self.beatsaver_cachefile, "w+") as scrapedcache_fp:
# json.dump(self._beatsaver_cache, scrapedcache_fp)

def _get_beatsaver_info_by_api(self, level_id):
Expand Down

0 comments on commit e4ec119

Please sign in to comment.