Skip to content

Commit 9ca1576

Browse files
committed
Revert "thumbnail: Fix path for thumb output"
This reverts commit 5a1419d. Turns out that, even if the multi-directory organization was the INTENT, it can't be used. The asset-consolidation logic in project_data:move_temp_paths_to_project_folder expects only files, not directories, in the thumbnail dir.
1 parent 2b386db commit 9ca1576

File tree

1 file changed

+6
-10
lines changed

1 file changed

+6
-10
lines changed

src/classes/thumbnail.py

+6-10
Original file line numberDiff line numberDiff line change
@@ -151,16 +151,12 @@ def do_GET(self):
151151

152152
# Locate thumbnail
153153
thumb_path = os.path.join(info.THUMBNAIL_PATH, file_id, "%s.png" % file_frame)
154-
if not os.path.exists(thumb_path):
155-
if file_frame == 1:
156-
# Try ID with no frame # (for backwards compatibility)
157-
alt_path = os.path.join(info.THUMBNAIL_PATH, "%s.png" % file_id)
158-
else:
159-
# Try with ID and frame # in filename (for backwards compatibility)
160-
alt_path = os.path.join(info.THUMBNAIL_PATH, "%s-%s.png" % (file_id, file_frame))
161-
162-
if os.path.exists(alt_path):
163-
thumb_path = alt_path
154+
if not os.path.exists(thumb_path) and file_frame == 1:
155+
# Try ID with no frame # (for backwards compatibility)
156+
thumb_path = os.path.join(info.THUMBNAIL_PATH, "%s.png" % file_id)
157+
if not os.path.exists(thumb_path) and file_frame != 1:
158+
# Try with ID and frame # in filename (for backwards compatibility)
159+
thumb_path = os.path.join(info.THUMBNAIL_PATH, "%s-%s.png" % (file_id, file_frame))
164160

165161
if not os.path.exists(thumb_path):
166162
# Generate thumbnail (since we can't find it)

0 commit comments

Comments
 (0)