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"`
[config/config.example.yml]
- Separate hide_shorts_and_live to hide_shorts and hide_livestreams
[config/sql/channel_videos.sql]
- Introduce enum video_type
- Include video_type as new column for channel_videos
[locales/en-US.json]
- Add labels for new settings
[src/invidious/channels/channels.cr]
- Add property video_type of type VideoType to ChannelVideo struct
- Add deserializer module for conversion from database entry to enum
- Add check if we already have a video in the database.
If the video `updated` field has no been updated, only update views
- Add check whether a video is in the `videos` array. If this is not
the case, fetch the individual video for `video_type` as well as
`length_videos`
[src/invidious/config.cr]
- Separate hide_shorts_and_live property
to hide_shorts and hide_livestreams properties
[src/invidious/database/channels.cr]
- Include video_type in database insert for ChannelVideo
[src/invidious/routes/preferences.cr]
- Separate hide_shorts_and_live setting to hide_shorts and hide_livestreams
[src/invidious/users.cr]
- Accumulate VideoTypes in an array and query on these types
- Remove paths for hide_shorts_and_live
[src/invidious/videos.cr]
- Add `Short` entry to VideoType enum
[src/invidious/videos/parser.cr]
- Add check whether a video is a short
[src/invidious/users.cr]
- Filter out shorts and livestreams in SQL rather than via an array
selector. This way, in the relevant cases, we will query and return
"limit" amount of videos, rather than a possible lower amount
[config/config.example.yml]
- Introduce new default value for hide_shorts_and_live
[locales/en-US.json]
- Add translation label for hide_shorts_and_live
[src/invidious/config.cr]
- Add default value for hide_shorts_and_live to ConfigPreferences
[src/invidious/users.cr]
- Add filtering for shorts and listreams if hide_shorts_and_live is active
[src/invidious/routes/preferences.cr]
- Retrieve and convert hide_shorts_and_live option from preferences page
to preferences object
[src/invidious/user/preferences.cr]
- Add hide_shorts_and_live property
[src/invidious/views/user/preferences.ecr]
- Add div, label and input for new hide_shorts_and_live option
* 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.
Running `crystal spec` without a file argument essentially produces one
big program that combines every single spec file, their imports, and
the files that those imports themselves depend on. Most of the types
within this combined program will get ignored by the compiler due to a
lack of any calls to them from the spec files.
But for some types, partially the HTTP module ones, using them within
the spec files will suddenly make the compiler enable a bunch of
previously ignored code. And those code will suddenly require the
presence of additional types, constants, etc. This not only make it
annoying for getting the specs working but also makes it difficult to
isolate behaviors for testing.
The `static_assets_handler_spec.cr` causes this issue and so will be
marked as an isolated spec for now. In the future all of the tests
should be organized into independent groupings similar to how the
Crystal compiler splits their tests into std, compiler, primitives and
interpreter.
Overriding `#call` or patching out `serve_file_compressed` provides
only minimal benefits over the ease of maintenance granted by only
overriding what we need to for the caching behavior.