Fast indexing (#58)
* 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
This commit is contained in:
@@ -19,6 +19,7 @@ defmodule Pinchflat.MediaFixtures do
|
||||
title: Faker.Commerce.product_name(),
|
||||
original_url: "https://www.youtube.com/watch?v=#{media_id}",
|
||||
livestream: false,
|
||||
short_form_content: false,
|
||||
media_filepath: "/video/#{Faker.File.file_name(:video)}",
|
||||
source_id: SourcesFixtures.source_fixture().id
|
||||
})
|
||||
@@ -65,4 +66,18 @@ defmodule Pinchflat.MediaFixtures do
|
||||
merged_attrs = Map.merge(attrs, %{media_filepath: stored_media_filepath})
|
||||
media_item_fixture(merged_attrs)
|
||||
end
|
||||
|
||||
def media_attributes_return_fixture do
|
||||
media_attributes = %{
|
||||
id: "video1",
|
||||
title: "Video 1",
|
||||
webpage_url: "https://example.com/video1",
|
||||
was_live: false,
|
||||
description: "desc1",
|
||||
aspect_ratio: 1.67,
|
||||
duration: 123.45
|
||||
}
|
||||
|
||||
Phoenix.json_library().encode!(media_attributes)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -35,23 +35,29 @@ defmodule Pinchflat.SourcesFixtures do
|
||||
%{
|
||||
id: "video1",
|
||||
title: "Video 1",
|
||||
original_url: "https://example.com/video1",
|
||||
webpage_url: "https://example.com/video1",
|
||||
was_live: false,
|
||||
description: "desc1"
|
||||
description: "desc1",
|
||||
aspect_ratio: 1.67,
|
||||
duration: 12.34
|
||||
},
|
||||
%{
|
||||
id: "video2",
|
||||
title: "Video 2",
|
||||
original_url: "https://example.com/video2",
|
||||
webpage_url: "https://example.com/video2",
|
||||
was_live: true,
|
||||
description: "desc2"
|
||||
description: "desc2",
|
||||
aspect_ratio: 1.67,
|
||||
duration: 345.67
|
||||
},
|
||||
%{
|
||||
id: "video3",
|
||||
title: "Video 3",
|
||||
original_url: "https://example.com/video3",
|
||||
webpage_url: "https://example.com/video3",
|
||||
was_live: false,
|
||||
description: "desc3"
|
||||
description: "desc3",
|
||||
aspect_ratio: 1.0,
|
||||
duration: 678.90
|
||||
}
|
||||
]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user