diff --git a/config/config.example.yml b/config/config.example.yml index cabbecfd7..2b99345b2 100644 --- a/config/config.example.yml +++ b/config/config.example.yml @@ -61,39 +61,32 @@ db: ## When this setting is commented out, Invidious companion is not used. ## Otherwise, Invidious will proxy the requests to Invidious companion. ## -## Note: multiple URL can be configured. In this case, invidious will +## Note: multiple URL can be configured. In this case, Invidious will ## randomly pick one every time video data needs to be retrieved. This ## URL is then kept in the video metadata cache to allow video playback ## to work. Once said cache has expired, requesting that video's data ## again will cause a new companion URL to be picked. ## -## The parameter private_url needs to be configured for the internal -## communication between the companion and Invidious. -## And public_url is the public URL from which companion is listening -## to the requests from the user(s). +## The parameter private_url is required for the internal communication +## between Invidious companion and Invidious. ## -## If you are using a reverse proxy then you will probably need to -## configure the public_url to be the same as the domain used for Invidious. -## Also apply when used from an external IP address (without a domain). -## Examples: https://MYINVIDIOUSDOMAIN/companion or http://192.168.1.100:8282/companion -## -## Both parameter can have identical URL when Invidious is hosted in -## an internal network or at home or locally (localhost). -## -## NOTE: If public_url is omitted, Invidious will use its built-in proxy -## to route companion requests through /companion, which is useful for -## simple setups where companion runs on the same network. When using -## the built-in proxy, CSP headers are not modified since requests -## stay within the same domain. +## The optional parameter public_url is the public URL from which +## Invidious companion is listening to the requests from the user(s). +## When this setting is commented out, Invidious proxy all requests to +## Invidious companion. Useful for simple setups. +## Otherwise, requests from the user(s) will reach Invidious companion directly. +## And you will need to configure a reverse proxy with separate routes +## for Invidious and Invidious companion. +## Read the post-install documentation for advanced reverse proxy +## documentation: https://docs.invidious.io/installation/#post-install-configuration ## ## Accepted values: "http(s)://:" ## Default: ## #invidious_companion: # - private_url: "http://localhost:8282/companion" -# public_url: "http://localhost:8282/companion" -# # Example with built-in proxy (omit public_url): -# # - private_url: "http://localhost:8282/companion" +# # Uncomment for advanced reverse proxy configuration (see above). +# # public_url: "http://localhost:8282/companion" ## ## API key for Invidious companion, used for securing the communication diff --git a/locales/en-US.json b/locales/en-US.json index 3f42a5090..fa28e7f8b 100644 --- a/locales/en-US.json +++ b/locales/en-US.json @@ -122,6 +122,8 @@ "Redirect homepage to feed: ": "Redirect homepage to feed: ", "preferences_max_results_label": "Number of videos shown in feed: ", "preferences_sort_label": "Sort videos by: ", + "preferences_default_playlist": "Default playlist: ", + "preferences_default_playlist_none": "No default playlist set", "published": "published", "published - reverse": "published - reverse", "alphabetically": "alphabetically", diff --git a/locales/es.json b/locales/es.json index 46217943b..686e13f93 100644 --- a/locales/es.json +++ b/locales/es.json @@ -78,6 +78,8 @@ "Redirect homepage to feed: ": "Redirigir la página de inicio a la fuente: ", "preferences_max_results_label": "Número de videos mostrados en la fuente: ", "preferences_sort_label": "Ordenar los videos por: ", + "preferences_default_playlist": "Lista de reproducción por defecto: ", + "preferences_default_playlist_none": "Ninguna lista de reproducción por defecto establecida", "published": "fecha de publicación", "published - reverse": "fecha de publicación: orden inverso", "alphabetically": "alfabéticamente", diff --git a/src/invidious/config.cr b/src/invidious/config.cr index e47e405ce..36f09d282 100644 --- a/src/invidious/config.cr +++ b/src/invidious/config.cr @@ -52,6 +52,8 @@ struct ConfigPreferences property vr_mode : Bool = true property show_nick : Bool = true property save_player_pos : Bool = false + @[YAML::Field(ignore: true)] + property default_playlist : String? = nil def to_tuple {% begin %} diff --git a/src/invidious/routes/preferences.cr b/src/invidious/routes/preferences.cr index 39ca77c06..9936e5230 100644 --- a/src/invidious/routes/preferences.cr +++ b/src/invidious/routes/preferences.cr @@ -144,6 +144,8 @@ module Invidious::Routes::PreferencesRoute notifications_only ||= "off" notifications_only = notifications_only == "on" + default_playlist = env.params.body["default_playlist"]?.try &.as(String) + # Convert to JSON and back again to take advantage of converters used for compatibility preferences = Preferences.from_json({ annotations: annotations, @@ -180,6 +182,7 @@ module Invidious::Routes::PreferencesRoute vr_mode: vr_mode, show_nick: show_nick, save_player_pos: save_player_pos, + default_playlist: default_playlist, }.to_json) if user = env.get? "user" diff --git a/src/invidious/user/preferences.cr b/src/invidious/user/preferences.cr index 0a8525f36..df195dd69 100644 --- a/src/invidious/user/preferences.cr +++ b/src/invidious/user/preferences.cr @@ -56,6 +56,7 @@ struct Preferences property extend_desc : Bool = CONFIG.default_user_preferences.extend_desc property volume : Int32 = CONFIG.default_user_preferences.volume property save_player_pos : Bool = CONFIG.default_user_preferences.save_player_pos + property default_playlist : String? = nil module BoolToString def self.to_json(value : String, json : JSON::Builder) diff --git a/src/invidious/views/user/preferences.ecr b/src/invidious/views/user/preferences.ecr index cf8b55936..23cb89f69 100644 --- a/src/invidious/views/user/preferences.ecr +++ b/src/invidious/views/user/preferences.ecr @@ -126,6 +126,19 @@ checked<% end %>> + <% if user = env.get?("user").try &.as(User) %> + <% playlists = Invidious::Database::Playlists.select_user_created_playlists(user.email) %> +
+ + +
+ <% end %> + <%= translate(locale, "preferences_category_visual") %>
diff --git a/src/invidious/views/watch.ecr b/src/invidious/views/watch.ecr index 6f9ced6fc..fada6361b 100644 --- a/src/invidious/views/watch.ecr +++ b/src/invidious/views/watch.ecr @@ -163,7 +163,7 @@ we're going to need to do it here in order to allow for translations.