Skip to content

Commit

Permalink
Revert "thumbnail: Fix path for thumb output"
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
ferdnyc committed Dec 6, 2019
1 parent 2b386db commit 9ca1576
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions src/classes/thumbnail.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,16 +151,12 @@ def do_GET(self):

# Locate thumbnail
thumb_path = os.path.join(info.THUMBNAIL_PATH, file_id, "%s.png" % file_frame)
if not os.path.exists(thumb_path):
if file_frame == 1:
# Try ID with no frame # (for backwards compatibility)
alt_path = os.path.join(info.THUMBNAIL_PATH, "%s.png" % file_id)
else:
# Try with ID and frame # in filename (for backwards compatibility)
alt_path = os.path.join(info.THUMBNAIL_PATH, "%s-%s.png" % (file_id, file_frame))

if os.path.exists(alt_path):
thumb_path = alt_path
if not os.path.exists(thumb_path) and file_frame == 1:
# Try ID with no frame # (for backwards compatibility)
thumb_path = os.path.join(info.THUMBNAIL_PATH, "%s.png" % file_id)
if not os.path.exists(thumb_path) and file_frame != 1:
# Try with ID and frame # in filename (for backwards compatibility)
thumb_path = os.path.join(info.THUMBNAIL_PATH, "%s-%s.png" % (file_id, file_frame))

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

0 comments on commit 9ca1576

Please sign in to comment.