Skip to content

Commit

Permalink
Is public stats
Browse files Browse the repository at this point in the history
  • Loading branch information
iwatkot authored Feb 15, 2025
1 parent 7142043 commit 21cb55d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 16 deletions.
18 changes: 2 additions & 16 deletions maps4fs/generator/map.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,9 @@ def __init__(
"rotation": rotation,
"dtm_provider": dtm_provider.name(),
"custom_osm": bool(custom_osm),
"is_public": self.is_session_public(),
"is_public": kwargs.get("is_public", False),
}
print(main_settings)
send_main_settings(main_settings)
except Exception as e:
self.logger.error("Error sending main settings: %s", e)
Expand Down Expand Up @@ -348,18 +349,3 @@ def get_country_by_coordinates(self) -> str:
self.logger.error("Error getting country name by coordinates: %s", e)
return "Unknown"
return "Unknown"

def is_session_public(self) -> bool | str:
"""Check if the session is public.
Returns:
bool: True if the session is public, False otherwise.
If an error occurs, returns "Unknown".
"""
try:
from webui.config import is_public

return is_public()
except Exception as e:
self.logger.error("Error checking if the session is public: %s", e)
return "Unknown"
1 change: 1 addition & 0 deletions webui/generator/generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,7 @@ def read_generation_settings(self) -> tuple[mfs.Map, str]:
texture_custom_schema=texture_schema,
tree_custom_schema=tree_schema,
custom_background_path=self.expert_settings.custom_background_path,
is_public=self.public,
)

return mp, session_name
Expand Down

0 comments on commit 21cb55d

Please sign in to comment.