* Add media streaming (#108) * [WIP] set up streaming route * Added UUID to sources and media items * Added media preview to MI show page * Added plug to strip file extensions * [VERY WIP] basic podcast RSS setup * [WIP] got basic podcast RSS working * [WIP] more expanding on RSS * Comment * [WIP] Working on refactoring feed * Added UUID backfill to a migration * [WIP] Moar refactoring * [WIP] Adding UI for getting RSS feed * Many tests * Added conditional routing for feed URLs * Removed the need for url_base to be set * Updated preset name * Rendered certain fields HTML-safe; Added logging to confirm range request support * Fixed incorrect scheme issue * Updated env var * Updated other UI to use dropdown * removed commented code * Generate rss feeds (#123) * Added plug to strip file extensions * [VERY WIP] basic podcast RSS setup * [WIP] got basic podcast RSS working * [WIP] more expanding on RSS * [WIP] Working on refactoring feed * Added UUID backfill to a migration * [WIP] Moar refactoring * [WIP] Adding UI for getting RSS feed * Many tests * Added conditional routing for feed URLs * Removed the need for url_base to be set * Updated preset name * Rendered certain fields HTML-safe; Added logging to confirm range request support * Fixed incorrect scheme issue * Updated env var * Updated other UI to use dropdown * removed commented code * docs * Added unique index to UUID fields
17 lines
469 B
Elixir
17 lines
469 B
Elixir
defmodule PinchflatWeb.MediaItems.MediaItemHTML do
|
|
use PinchflatWeb, :html
|
|
|
|
embed_templates "media_item_html/*"
|
|
|
|
def media_file_exists?(media_item) do
|
|
!!media_item.media_filepath and File.exists?(media_item.media_filepath)
|
|
end
|
|
|
|
def media_type(media_item) do
|
|
case Path.extname(media_item.media_filepath) do
|
|
ext when ext in [".mp4", ".webm", ".mkv"] -> :video
|
|
ext when ext in [".mp3", ".m4a"] -> :audio
|
|
_ -> :unknown
|
|
end
|
|
end
|
|
end
|