Add docs link (#103)

* Added docs link to README

* Added docs to sidebar in-app

* Updated some tests

* Updated docs in media profile form
This commit is contained in:
Kieran
2024-03-21 17:26:51 -07:00
committed by GitHub
parent 66b14c3d8f
commit 37eb745d03
30 changed files with 1657 additions and 1714 deletions
@@ -73,7 +73,7 @@ defmodule Pinchflat.Downloading.MediaDownloaderTest do
test "it extracts the title", %{media_item: media_item} do
assert {:ok, updated_media_item} = MediaDownloader.download_for_media_item(media_item)
assert updated_media_item.title == "Trying to Wheelie Without the Rear Brake"
assert updated_media_item.title == "Pinchflat Example Video"
end
test "it extracts the description", %{media_item: media_item} do
@@ -11,7 +11,7 @@ defmodule Pinchflat.Metadata.MetadataParserTest do
test "it extracts the media filepath", %{metadata: metadata} do
result = Parser.parse_for_media_item(metadata)
assert String.contains?(result.media_filepath, "bwRHIkYqYJo")
assert String.contains?(result.media_filepath, "Pinchflat Example Video-ABC123")
assert String.ends_with?(result.media_filepath, ".mkv")
end
@@ -6,7 +6,7 @@ defmodule Pinchflat.YtDlp.MediaCollectionTest do
alias Pinchflat.YtDlp.Media
alias Pinchflat.YtDlp.MediaCollection
@channel_url "https://www.youtube.com/c/TheUselessTrials"
@channel_url "https://www.youtube.com/c/PinchflatTestChannel"
setup :verify_on_exit!
@@ -77,10 +77,10 @@ defmodule Pinchflat.YtDlp.MediaCollectionTest do
test "it returns a map with data on success" do
expect(YtDlpRunnerMock, :run, fn _url, _opts, _ot ->
Phoenix.json_library().encode(%{
channel: "TheUselessTrials",
channel: "PinchflatTestChannel",
channel_id: "UCQH2",
playlist_id: "PLQH2",
playlist_title: "TheUselessTrials - Videos"
playlist_title: "PinchflatTestChannel - Videos"
})
end)
@@ -88,9 +88,9 @@ defmodule Pinchflat.YtDlp.MediaCollectionTest do
assert %{
channel_id: "UCQH2",
channel_name: "TheUselessTrials",
channel_name: "PinchflatTestChannel",
playlist_id: "PLQH2",
playlist_name: "TheUselessTrials - Videos"
playlist_name: "PinchflatTestChannel - Videos"
} = res
end
@@ -121,12 +121,12 @@ defmodule Pinchflat.YtDlp.MediaCollectionTest do
describe "get_source_metadata/1" do
test "it returns a map with data on success" do
expect(YtDlpRunnerMock, :run, fn _url, _opts, _ot ->
Phoenix.json_library().encode(%{channel: "TheUselessTrials"})
Phoenix.json_library().encode(%{channel: "PinchflatTestChannel"})
end)
assert {:ok, res} = MediaCollection.get_source_metadata(@channel_url)
assert %{"channel" => "TheUselessTrials"} = res
assert %{"channel" => "PinchflatTestChannel"} = res
end
test "it passes the expected args to the backend runner" do
+1 -1
View File
@@ -36,7 +36,7 @@ defmodule Pinchflat.YtDlp.MediaTest do
{:ok, render_metadata(:media_metadata)}
end)
assert {:ok, %{"title" => "Trying to Wheelie Without the Rear Brake"}} =
assert {:ok, %{"title" => "Pinchflat Example Video"}} =
Media.download(@media_url)
end