From 2028dfbd4e413c5384fe8f619ce1679b9ca47479 Mon Sep 17 00:00:00 2001 From: ebolam Date: Wed, 21 Dec 2022 14:38:42 -0500 Subject: [PATCH] Fix for creating multiple story copies when loading a v1 story --- fileops.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/fileops.py b/fileops.py index a195bb06..8a25ae25 100644 --- a/fileops.py +++ b/fileops.py @@ -66,6 +66,9 @@ def getdirpath(dir, title): # Returns the path (as a string) to the given story by its 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") #==================================================================#