-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
feat: pages_enabled admin controls with subscription-only search #4674
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
NorkzYT
wants to merge
39
commits into
iv-org:master
Choose a base branch
from
NorkzYT:optional-disable-api-features
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
39 commits
Select commit
Hold shift + click to select a range
e613e3c
feat: optional `trending_enabled` and `search_enabled` params added
5fa2935
fix(feeds.cr): http status code
NorkzYT 3abf216
fix(search.cr): http status code
e0f20b0
style(feeds.cr): fix code formatting
da422fa
feat(invidious): specific pages are disabled with the use of an array
ba7e504
chore(search.cr): add newline at end of file
bfe5159
chore(lint): format with crystal tool
2ec34f3
Update config/config.example.yml
NorkzYT b0cbd29
feat(en-US.json): add translation key and value
fdec904
Update src/invidious/views/user/preferences.ecr
NorkzYT 209360e
Merge branch 'master' into optional-disable-api-features
NorkzYT b4f8a67
Merge branch 'iv-org:master' into optional-disable-api-features
NorkzYT a077509
Merge branch 'master' into optional-disable-api-features
NorkzYT aeb2b10
feat: test
ce0a9fa
feat: test2
171bac9
Update locales/en-US.json
NorkzYT e1d134f
Update locales/en-US.json
NorkzYT 9fbce52
📝 (locales/en-US.json): remove redundant translation strings
NorkzYT 3eeec86
🌐 (feeds.cr, search.cr): update translation keys for disabled feeds a…
NorkzYT e238624
feat(config.cr): introduce PagesEnabled struct for managing feature t…
NorkzYT 116a5db
Merge branch 'iv-org:master' into optional-disable-api-features
NorkzYT ba65e4f
Config: Use from_yaml constructor for PagesEnabled
syeopite d496b6e
Use `PagesEnabled` struct when setting pages_enabled
syeopite f978c2b
Fix config precedence with popular_enabled
syeopite 245ffc8
Mark attributes set over env var as present if needed
syeopite 20e4e52
Add tests for `popular_enabled` deprecation logic
syeopite 24d0724
chore: disable trending by default
NorkzYT dee1bd6
chore: missing hash key issue
NorkzYT ef59312
latest from master
NorkzYT 03634db
Merge branch 'master' into optional-disable-api-features
NorkzYT 8c922d0
revert docker compose file
NorkzYT 2933c7e
Merge branch 'master' into optional-disable-api-features
NorkzYT bd6dd9c
feat: add search_page_disabled locale + preferences page filtering + …
NorkzYT ea36b2b
fix(preferences): unchecked pages_enabled checkboxes now persist corr…
NorkzYT 562389b
fix(pages_enabled): hide search UI and block all search routes when d…
NorkzYT 0eb941f
feat(search): subscription-only search mode when YouTube search is di…
NorkzYT 58ced28
fix(playlists): prevent duplicate videos in the same playlist
NorkzYT 8cd5f0f
fix(search_homepage): center subscription hint text under search bar
NorkzYT 7ca2bbd
fix(before_all): halt response after rendering disabled page error
NorkzYT File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,50 @@ | ||
| require "../spec_helper" | ||
| require "../../src/invidious/jobs.cr" | ||
| require "../../src/invidious/jobs/*" | ||
| require "../../src/invidious/config.cr" | ||
| require "../../src/invidious/user/preferences.cr" | ||
|
|
||
| # Allow this file to be executed independently of other specs | ||
| {% if !@type.has_constant?("CONFIG") %} | ||
| CONFIG = Config.from_yaml("") | ||
| {% end %} | ||
|
|
||
| private def construct_config(yaml) | ||
| config = Config.from_yaml(yaml) | ||
| File.open(File::NULL, "w") { |io| config.process_deprecation(io) } | ||
| return config | ||
| end | ||
|
|
||
| Spectator.describe Config do | ||
| context "page_enabled" do | ||
| it "Can disable pages" do | ||
| config = construct_config <<-YAML | ||
| pages_enabled: | ||
| popular: false | ||
| search: false | ||
| YAML | ||
|
|
||
| expect(config.page_enabled?("trending")).to eq(false) | ||
| expect(config.page_enabled?("popular")).to eq(false) | ||
| expect(config.page_enabled?("search")).to eq(false) | ||
| end | ||
|
|
||
| it "Takes precedence over popular_enabled" do | ||
| config = construct_config <<-YAML | ||
| popular_enabled: false | ||
| pages_enabled: | ||
| popular: true | ||
| YAML | ||
|
|
||
| expect(config.page_enabled?("popular")).to eq(true) | ||
| end | ||
| end | ||
|
|
||
| it "Deprecated popular_enabled still works" do | ||
| config = construct_config <<-YAML | ||
| popular_enabled: false | ||
| YAML | ||
|
|
||
| expect(config.page_enabled?("popular")).to eq(false) | ||
| end | ||
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.