Make image [un]hiding wipe thumb target pre-transfer and not need source

This commit is contained in:
Nebbie Zebbie 2020-02-10 22:32:00 +00:00
parent 0a93da7952
commit 8f7a9b7c50

View file

@ -9,14 +9,16 @@ defmodule Philomena.Images.Hider do
source = image_thumb_dir(image)
target = image_thumb_dir(image, key)
File.rename!(source, target)
File.rm_rf(target)
File.rename(source, target)
end
def unhide_thumbnails(image, key) do
source = image_thumb_dir(image, key)
target = image_thumb_dir(image)
File.rename!(source, target)
File.rm_rf(target)
File.rename(source, target)
end
# fixme: these are copied from the thumbnailer