* Made method to getting singular media details; Renamed other related method * Takes a fun and flirty digression to remove abstractions around yt-dlp since I'm 100% committed to using it exclusively * Removed commented test code * Lays the groundwork for fast indexing * Added module for working with youtube RSS feed * Added methods to kick off indexing workers from RSS response * Improve short detection (#59) * Made media attribute-related yt-dlp calls return a struct * Added shorts attribute to media items * Added ability to discern a short from yt-dlp response * Updated search to use new shorts attribute * Fast index UI (#63) * Added fast_index field and adds it to source form * Added fast indexing to source changeset operations * Added fast indexing worker and updated other modules to start using it * Handled fast index worker on source update * Add support modals (#65) * Added fast indexing upgrade modal * Improved modal on smaller screens * Updated links to work again * Added donation modal * Reverted source fast index to 15 minutes * Removed unneeded HTML attributes from old alpine approach
31 lines
991 B
Elixir
31 lines
991 B
Elixir
defmodule Pinchflat.Profiles.OutputPathBuilderTest do
|
|
use Pinchflat.DataCase
|
|
|
|
alias Pinchflat.Profiles.OutputPathBuilder
|
|
|
|
describe "build/2" do
|
|
test "it expands 'standard' curly brace variables in the template" do
|
|
assert {:ok, res} = OutputPathBuilder.build("/videos/{{ title }}.{{ ext }}")
|
|
|
|
assert res == "/videos/%(title)S.%(ext)S"
|
|
end
|
|
|
|
test "it expands 'custom' curly brace variables in the template" do
|
|
assert {:ok, res} = OutputPathBuilder.build("/videos/{{ upload_year }}.{{ ext }}")
|
|
|
|
assert res == "/videos/%(upload_date>%Y)S.%(ext)S"
|
|
end
|
|
|
|
test "it respects additional options" do
|
|
assert {:ok, res} = OutputPathBuilder.build("/videos/{{ custom }}.{{ ext }}", %{"custom" => "test"})
|
|
|
|
assert res == "/videos/test.%(ext)S"
|
|
end
|
|
|
|
test "it leaves yt-dlp variables alone" do
|
|
assert {:ok, res} = OutputPathBuilder.build("/videos/%(title)s.%(ext)s")
|
|
|
|
assert res == "/videos/%(title)s.%(ext)s"
|
|
end
|
|
end
|
|
end
|