Powered by AppSignal & Oban Pro
Would you like to see your link here? Contact us

remove_screenshots_not_on_flickr

remove_screenshots_not_on_flickr.livemd

remove_screenshots_not_on_flickr

use QuickAlias, MyAppWeb
use QuickAlias, MyAppBe
use QuickAlias, MyApp

require Ecto.Query
require Ash.Query
import MyApp.MavuEntities.UuidGuards

Section

screenshots_not_on_flickr=
Event
# |> Ash.Query.select([:screenshot_mf])
|> Ash.Query.filter(screenshot_mf.ref_prefix == "ev" and is_nil(screenshot_mf.flickr_id))
|> Ash.Query.load([:screenshot_mf])
|> Ash.read!()
|> Enum.map(fn a -> a.screenshot_mf end)

screenshots_not_on_flickr |> length()
mf=screenshots_not_on_flickr  |> hd()
lc=LogContext.new()
for mf <- screenshots_not_on_flickr do
  MyApp.EselfileUploadJob.queue_upload_job(lc,mf.id)
end
mfnew=MavuFile.resolve!(mf.id)