The return from before_all did not stop the route handler from
executing. The trending/popular/hashtag routes still ran and
overwrote the 403 response. Now set a halted flag and use Kemal
halt in the before_all block to prevent route handler execution.
Error page now renders with the full Invidious theme (dark mode,
navbar, CSS) matching the rest of the UI.
Check if the video already exists in the playlist before inserting.
Uses the existing select_index() query. Returns 409 via the API and
silently redirects back on the web UI.
Applied to both the web route (playlist_ajax) and the API v1 route
(POST /api/v1/auth/playlists/:plid/videos).
When pages_enabled.search is false, instead of blocking search entirely,
the search bar now searches within the user's subscriptions and saved
playlists only. YouTube's search API is never called.
Changes:
- routes/search.cr: detect search_disabled, force subscription+playlist
search for logged-in users, 403 for anonymous users
- search/processors.cr: new subscriptions_and_playlists() method that
queries both the subscription materialized view and playlist_videos
table, merges and deduplicates results
- before_all.cr: let /search through to the route handler (APIs still
blocked), keep /hashtag/* blocked
- search_box.ecr: dynamic placeholder ("Search subscriptions & playlists")
- search_homepage.ecr: hint text when in subscription-only mode
- search.ecr: hide YouTube filters, show lock icon + notice, custom
empty-results message
- template.ecr: always show search bar (subscription search needs it)
- en-US.json: 6 new locale strings for subscription-only search UX
- Hide navbar search box when CONFIG.page_enabled?("search") is false
- Keep Invidious logo visible with proper width when search bar is hidden
- Hide search widget on search_homepage when search is disabled
- Block /results, /api/v1/search/suggestions in before_all guard
- Block /hashtag/* and /api/v1/hashtag/* when search is disabled
HTML checkboxes send no value when unchecked, so the fallback
"|| \"on\"" always re-enabled popular/trending/search on save.
Changed default to "off" to match the pattern used by captcha_enabled,
login_enabled, and other checkbox toggles in the same handler.
- Fix kemal_static_file_handler directory_listing to use Path types (Crystal API compat)
- Add missing search_page_disabled translation key to en-US.json
- Filter preferences default_home options based on pages_enabled config
- Add admin-only /debug_config route for verifying configuration state
When switching between Listen and Watching the timestamp in the url of
the listen of watch button is now updated automatically.
This means if you switch between listening and viewing you keep in sync
with time.
* Remove sort by rating and date in video search filters
Closes https://github.com/iv-org/invidious/issues/5626
* Remove check of protobug generation of rating and date sort filters in Invidious spec
thin_mode only took in account the query param because
env.get("preferences").as(Preferences).thin_mode returned a boolean and
not a string to be able to compare it with the string `"true"`
* doc: Update HTTP proxy configuration comments
Added information about proxy configuration for YouTube streams.
* Document supported proxy types in config.example.yml
Added note about supported proxy types in configuration.
Image responses contained the following unwanted headers that should not
be passed to the clients:
```
"Cross-Origin-Resource-Policy"
["cross-origin"]
"Cross-Origin-Opener-Policy-Report-Only"
["same-origin; report-to=\"youtube\""]
"Report-To"
["{\"group\":\"youtube\",\"max_age\":2592000,\"endpoints\":[{\"url\":\"https://csp.withgoogle.com/csp/report-to/youtube\"}]}"]
"Timing-Allow-Origin"
["*"]
```
* downgrade to 1.16.3
* Downgrade Alpine base image from 3.23 to 3.22
---------
Co-authored-by: Émilien (perso) <4016501+unixfox@users.noreply.github.com>
* Allow downloading via companion
* post request where not proxied for the download companion which made
it impossible to download with the companion enabled
* Re-apply Channel to Channels rename which was pulled in
* Update src/invidious/routes/companion.cr
* doc: better comments for each route
---------
Co-authored-by: Fijxu <fijxu@nadeko.net>
Co-authored-by: Émilien (perso) <4016501+unixfox@users.noreply.github.com>
* Replace deprecated `blocking` property of `Socket`
This replaces the deprecated argument `blocking` and uses
`Socket.set_blocking(fd, value)` instead.
Fixes a warning in the compiler
https://github.com/crystal-lang/crystal/pull/16033
* Upgrade to upstream
* chore: only Socket.set_blocking for > 1.18
---------
Co-authored-by: Emilien <4016501+unixfox@users.noreply.github.com>
Summing the sizes of each cached file every time is very inefficient.
Instead we can simply store the cache size in an constant and increase
it everytime a file is added into the cache.