Skip to content

Commit

Permalink
Fix missing translations when there is more than one release for a la…
Browse files Browse the repository at this point in the history
…nguage (#181)

Co-authored-by: Martin Robertz <[email protected]>
  • Loading branch information
wlhlm and Dream-Master authored Dec 2, 2024
1 parent e697ee2 commit df33227
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions src/gtnh/modpack_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -296,9 +296,13 @@ async def update_versions_from_repo(

for release in sorted_releases:
if asset.has_version(release.tag_name):
# We don't support updating of tagged versions, so if we see a version we already have, skip it
# and the rest of the versions
break
if for_translation:
# Just skip it if we find a duplicate translation release, don't bail entirely
continue
else:
# We don't support updating of tagged versions, so if we see a version we already have, skip it
# and the rest of the versions
break

version = version_from_release(release, asset.type)
if not version:
Expand All @@ -308,16 +312,16 @@ async def update_versions_from_repo(
)
continue

if not for_translation and version_is_newer(version.version_tag, asset.latest_version):
if for_translation:
log.info(
f"Updating latest version for `{Fore.CYAN}{asset.name}{Fore.RESET}` "
f"{Style.DIM}{Fore.GREEN}{asset.latest_version}{Style.RESET_ALL} -> "
f"Updating version for `{Fore.CYAN}{asset.name}{Fore.RESET}` -> "
f"{Fore.GREEN}{version.version_tag}{Style.RESET_ALL}"
)
asset.latest_version = version.version_tag
elif for_translation:
elif version_is_newer(version.version_tag, asset.latest_version):
log.info(
f"Updating version for `{Fore.CYAN}{asset.name}{Fore.RESET}` -> "
f"Updating latest version for `{Fore.CYAN}{asset.name}{Fore.RESET}` "
f"{Style.DIM}{Fore.GREEN}{asset.latest_version}{Style.RESET_ALL} -> "
f"{Fore.GREEN}{version.version_tag}{Style.RESET_ALL}"
)
asset.latest_version = version.version_tag
Expand Down

0 comments on commit df33227

Please sign in to comment.