diff --git a/lib/pinchflat_web/controllers/settings/setting_html.ex b/lib/pinchflat_web/controllers/settings/setting_html.ex index dcb549a..340068b 100644 --- a/lib/pinchflat_web/controllers/settings/setting_html.ex +++ b/lib/pinchflat_web/controllers/settings/setting_html.ex @@ -14,9 +14,14 @@ defmodule PinchflatWeb.Settings.SettingHTML do def apprise_server_help do url = "https://github.com/caronc/apprise/wiki/URLBasics" - classes = "underline decoration-bodydark decoration-1 hover:decoration-white" - ~s(Server endpoint for Apprise notifications when new media is found. See Apprise docs for more information) + ~s(Server endpoint for Apprise notifications when new media is found. See Apprise docs for more information) + end + + def youtube_api_help do + url = "https://github.com/kieraneglin/pinchflat/wiki/Generating-a-YouTube-API-key" + + ~s(API key for YouTube Data API v3. Greatly improves the accuracy of Fast Indexing. See here for details on generating an API key) end def diagnostic_info_string do @@ -28,4 +33,8 @@ defmodule PinchflatWeb.Settings.SettingHTML do - Timezone: #{Application.get_env(:pinchflat, :timezone)} """ end + + defp help_link_classes do + "underline decoration-bodydark decoration-1 hover:decoration-white" + end end diff --git a/lib/pinchflat_web/controllers/settings/setting_html/setting_form.html.heex b/lib/pinchflat_web/controllers/settings/setting_html/setting_form.html.heex index 51062a9..2cf1701 100644 --- a/lib/pinchflat_web/controllers/settings/setting_html/setting_form.html.heex +++ b/lib/pinchflat_web/controllers/settings/setting_html/setting_form.html.heex @@ -37,7 +37,8 @@ placeholder="ABC123" type="text" label="YouTube API Key" - help="API key for YouTube Data API v3. Required for the improved fast indexing" + help={youtube_api_help()} + html_help={true} inputclass="font-mono text-sm mr-4" /> diff --git a/lib/pinchflat_web/controllers/sources/source_html/fast_indexing_help.html.heex b/lib/pinchflat_web/controllers/sources/source_html/fast_indexing_help.html.heex index 6cc2dc3..9d20706 100644 --- a/lib/pinchflat_web/controllers/sources/source_html/fast_indexing_help.html.heex +++ b/lib/pinchflat_web/controllers/sources/source_html/fast_indexing_help.html.heex @@ -9,10 +9,18 @@ to scan the entire source on your specified frequency, but it's very slow for large sources. This is the most accurate way to find uploaded media with the tradeoff being that pairing a large source that's indexed frequently will result in you spending most of your time indexing. Only so many indexing operations can be running at the same time so this can impact your other source's ability to index.
- Fast indexing takes a different approach. It still does an initial scan the slow way but after that it uses a secondary mechanism (either RSS or YouTube's API) to frequently check for new videos. This has the potential to be hundreds of times faster, but it can miss videos if the uploader un-privates an old video or uploads dozens of videos in the space of a few minutes. It works well for most channels but it's not perfect. + Fast indexing takes a different approach. It still does an initial scan the slow way but after that it uses a secondary mechanism (either RSS or YouTube's API) to frequently check for new videos. This has the potential to be hundreds of times faster, but it can miss videos if the uploader un-privates an old video or uploads dozens of videos in the space of a few minutes.
- RSS is used by default but if you want the most reliable fast indexing, you should enable the YouTube API. TODO LINK Here is some documentation on how to get your API key which you can add in your TODO LINK settings. + RSS is used by default but you should enable the YouTube API if you want the best version of fast indexing. This isn't needed for most users but it provides the fastest and most reliable media updates. + <.inline_link href="https://github.com/kieraneglin/pinchflat/wiki/Generating-a-YouTube-API-key"> + Here is some documentation + + on how to get your API key which you can add in the + <.inline_link href={~p"/settings"}> + settings + + page.
To make up for this limitation, a normal index is still run monthly to catch any videos that were missed by fast indexing. Fast indexing overrides the normal index frequency. @@ -20,9 +28,21 @@