From: Christopher Coté Date: Fri, 21 Mar 2025 02:02:46 +0000 (-0400) Subject: new pics and videos X-Git-Url: http://git.entropealabs.com/?a=commitdiff_plain;h=daff305bf661127e8a87103d840f436f4f5db17e;p=photography.git new pics and videos --- diff --git a/media/database.db-shm b/media/database.db-shm index 9266fce0..31449419 100644 Binary files a/media/database.db-shm and b/media/database.db-shm differ diff --git a/media/database.db-wal b/media/database.db-wal index aa9a08ed..be3764a8 100644 Binary files a/media/database.db-wal and b/media/database.db-wal differ diff --git a/media/image_metadata.exs b/media/image_metadata.exs index eac271b2..f70a4d32 100644 --- a/media/image_metadata.exs +++ b/media/image_metadata.exs @@ -143,7 +143,16 @@ defmodule Videos do end def parse_dir(dir, path) do - project = Path.join(path, "project.mp4") + project_mp4 = Path.join(path, "project.mp4") + project_webm = Path.join(path, "project.webm") + + {project, extension} = + if File.exists?(project_webm) do + {project_webm, ".webm"} + else + {project_mp4, ".mp4"} + end + thumb = Path.join(path, "thumbnail.jpg") if(File.dir?(path) and File.exists?(project) and File.exists?(thumb)) do @@ -151,7 +160,7 @@ defmodule Videos do data = File.read!(project) hash = :crypto.hash(:md5, data) encoded = Base.encode16(hash, case: :lower) - file = encoded <> ".mp4" + file = encoded <> extension v = case Repo.one(from(v in Video, where: v.original_path == ^project)) do @@ -258,11 +267,14 @@ defmodule Videos do |> ExAws.request(region: region) |> IO.inspect() + [_ | [ext | _]] = String.split(src_path, ".") + IO.inspect(ext) + src_path |> ExAws.S3.Upload.stream_file() |> ExAws.S3.upload(bucket, dest_path, timeout: :infinity, - content_type: "video/mp4", + content_type: "video/#{ext}", acl: :public_read ) |> IO.inspect() diff --git a/www/index.html b/www/index.html index 5aae9e36..b961e024 100644 --- a/www/index.html +++ b/www/index.html @@ -5,8 +5,8 @@ - - + + @@ -112,6 +112,8 @@
  • birthday
  • +
  • blackhawks
  • +
  • bonfire
  • brighton
  • @@ -259,339 +261,389 @@