-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The final fix to list hub and musiclists #152
The final fix to list hub and musiclists #152
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please remove write_read/
folder check everywhere, only check for read_only/
folders to consider it a read-only hub/musiclist/etc.
server/area.py
Outdated
if os.path.isfile(f"storage/musiclists/read_only/{self.music_ref}.yaml"): | ||
self.load_music(f"storage/musiclists/read_only/{self.music_ref}.yaml") | ||
else: | ||
self.load_music(f"storage/musiclists/write_read/{self.music_ref}.yaml") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove write_read/
, if it's not in a read_only/
folder then it's a read and write.
Otherwise this will just break all servers currently using KFO
server/commands/hubs.py
Outdated
@@ -112,7 +112,10 @@ def ooc_cmd_save_hub(client, arg): | |||
raise ArgumentError("Filename must be at least 3 symbols long!") | |||
try: | |||
if args[0] != "": | |||
path = "storage/hubs" | |||
if len(args) > 2 and args[2].lower() == "read_only": |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/save_hub args[0] args[1] args[2]
, args[2] doesn't exist.
this should be len(args) > 1 and args[1].lower()
, please check all instances of this
if len(args) > 2 and args[2].lower() == "read_only": | |
if len(args) > 1 and args[1].lower() == "read_only": |
server/commands/hubs.py
Outdated
@@ -122,14 +125,14 @@ def ooc_cmd_save_hub(client, arg): | |||
"Server storage full! Please contact the server host to resolve this issue." | |||
) | |||
try: | |||
if os.path.isfile(f"storage/hubs/read_only/{derelative(args[0])}.yaml"): | |||
raise ArgumentError(f"Hub {args[0]} already exists and it is read-only!") | |||
if os.path.isfile(f"storage/hubs/{derelative(args[0])}.yaml") and len(args) > 2 and args[2].lower() == "read_only": |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/save_hub args[0] args[1] args[2]
, args[2] doesn't exist.
this should be len(args) > 1 and args[1].lower()
, please check all instances of this
server/commands/music.py
Outdated
@@ -428,18 +434,18 @@ def ooc_cmd_musiclist_save(client, arg): | |||
return | |||
|
|||
if len(args) > 2 and args[2].lower() == "read_only": |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/save_hub args[0] args[1] args[2]
, args[2] doesn't exist.
this should be len(args) > 1 and args[1].lower()
, please check all instances of this
No description provided.