Fix for creating multiple story copies when loading a v1 story

This commit is contained in:
ebolam
2022-12-21 14:38:42 -05:00
parent 99135acdea
commit 2028dfbd4e

View File

@@ -66,6 +66,9 @@ def getdirpath(dir, title):
# Returns the path (as a string) to the given story by its name # Returns the path (as a string) to the given story by its name
#==================================================================# #==================================================================#
def storypath(name): def storypath(name):
if os.path.exists("stories/{}".format(name)) and os.path.isdir("stories/{}".format(name)):
if os.path.exists("stories/{}/story.json".format(name)):
return "stories/{}/story.json".format(name)
return path.join("stories", name + ".json") return path.join("stories", name + ".json")
#==================================================================# #==================================================================#