mirror of
https://github.com/philomena-dev/philomena.git
synced 2024-11-23 20:18:00 +01:00
feat(thumbnailer): purge cache for file when handling :replace_original from processors (#256)
This commit is contained in:
parent
0e0c446579
commit
d76be72a5d
1 changed files with 9 additions and 2 deletions
|
@ -5,6 +5,7 @@ defmodule Philomena.Images.Thumbnailer do
|
||||||
|
|
||||||
alias Philomena.DuplicateReports
|
alias Philomena.DuplicateReports
|
||||||
alias Philomena.ImageIntensities
|
alias Philomena.ImageIntensities
|
||||||
|
alias Philomena.ImagePurgeWorker
|
||||||
alias Philomena.Images.Image
|
alias Philomena.Images.Image
|
||||||
alias Philomena.Processors
|
alias Philomena.Processors
|
||||||
alias Philomena.Analyzers
|
alias Philomena.Analyzers
|
||||||
|
@ -103,8 +104,14 @@ defmodule Philomena.Images.Thumbnailer do
|
||||||
defp apply_change(image, {:intensities, intensities}),
|
defp apply_change(image, {:intensities, intensities}),
|
||||||
do: ImageIntensities.create_image_intensity(image, intensities)
|
do: ImageIntensities.create_image_intensity(image, intensities)
|
||||||
|
|
||||||
defp apply_change(image, {:replace_original, new_file}),
|
defp apply_change(image, {:replace_original, new_file}) do
|
||||||
do: upload_file(image, new_file, "full.#{image.image_format}")
|
full = "full.#{image.image_format}"
|
||||||
|
upload_file(image, new_file, full)
|
||||||
|
|
||||||
|
Exq.enqueue(Exq, "indexing", ImagePurgeWorker, [
|
||||||
|
Path.join(image_url_base(image, nil), full)
|
||||||
|
])
|
||||||
|
end
|
||||||
|
|
||||||
defp apply_change(image, {:thumbnails, thumbnails}),
|
defp apply_change(image, {:thumbnails, thumbnails}),
|
||||||
do: Enum.map(thumbnails, &apply_thumbnail(image, &1))
|
do: Enum.map(thumbnails, &apply_thumbnail(image, &1))
|
||||||
|
|
Loading…
Reference in a new issue