Skip to content
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

Add identifiers to channels hidden by ID #4230

Merged

Conversation

Benjababe
Copy link
Contributor

@Benjababe Benjababe commented Oct 25, 2023

Add identifiers to channels hidden by ID

Pull Request Type

  • Bugfix
  • Feature Implementation
  • Documentation
  • Other

Related issue

Closes #4181

Description

If a channel ID is provided (checks for UC at start and is 24 characters long), searches invidious or local API for the channel name and thumbnail and stores them.

If users have existing IDs hidden, when entering the settings page it will automatically try to update it with a channel name and icon.

Removed ability to hide by channel name, does a ID check ("UC"+22chars) on entry. Invalid IDs may pass but it'll stop on an API error for channel info retrieval

Also added link in the icon that goes to the creator's channel.

Screenshots

image

1.mp4

Had to use setTimeout to see how the UI updates as each channel gets updated. In practice, it's pretty instantaneous.

test-auto-update.mp4

image

Testing

Tried with

  • UC9_p50tH3WmMslWRWKnM7dQ (Adam Ragusea)
  • UCfsOfLvadg89Bx8Sv_6WERg (NoobFromUA)
  • UCXR5PCyUI2pG_a3ydnCIS-g (NesHacker)
  • 3DSage
  • engineerguy

Desktop

  • OS: Windows 10
  • OS Version: 22H2
  • FreeTube version:

@github-actions github-actions bot added the PR: waiting for review For PRs that are complete, tested, and ready for review label Oct 25, 2023
@FreeTubeBot FreeTubeBot enabled auto-merge (squash) October 25, 2023 08:42
@PikachuEXE
Copy link
Collaborator

If this is merged should we change #4228 to hide channel by channel ID?

Copy link
Collaborator

@PikachuEXE PikachuEXE left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shorten the code a bit first?

auto-merge was automatically disabled October 25, 2023 09:45

Head branch was pushed to by a user without write access

@FreeTubeBot FreeTubeBot enabled auto-merge (squash) October 25, 2023 09:45
auto-merge was automatically disabled October 25, 2023 10:54

Head branch was pushed to by a user without write access

@FreeTubeBot FreeTubeBot enabled auto-merge (squash) October 25, 2023 10:55
@LangLangBart
Copy link

Thank you. Works well.

Here are few points for consideration:

  1. The UI could be simplified by removing the ID and displaying only the icon and channel name, thereby eliminating the need for a tooltip.

  2. In the process of migrating channelsHidden settings from ~/Library/Application\ Support/FreeTube/settings.db to ~/Library/Application\ Support/Electron/settings.db, I've noticed that the channels don't update automatically. Currently, the user is required to manually delete each item and re-add them to the list. It becomes cumbersome as the ID cannot be simply copied but requires constant referencing back to the ~/Library/Application\ Support/FreeTube/settings.db file. This issue could benefit from a more efficient update process.

  3. When the window is very small, the ? shifts to the right, as shown in the video below:

Screen.Recording.2023-10-27.at.17.39.13.mov

everything above is UI related only and you can argue either way, the underlying problem is fixed with this PR

@LangLangBart
Copy link

LangLangBart commented Oct 27, 2023

  • adding UCVT1tPkR-fUVlO652EcO3ow ( CBS Sunday Morning ) seems to cause an issue with the image
Screen.Recording.2023-10-27.at.18.17.34.mov

EDIT However, this seems to have been a one-time issue as the image now displays correctly.

@absidue
Copy link
Member

absidue commented Oct 27, 2023

@LangLangBart When you are editing the files on disk, make sure FreeTube is completely closed.

Maybe it's time we add a lock on those files while FreeTube is running, so people stop editing them while FreeTube is running and wondering why stuff breaks.

@Benjababe
Copy link
Contributor Author

Updated it to just show the channel name.

Need suggestions on handling already blocked channels using ID. Like to do it automatically once on startup or have some button for the user to update them.

@absidue
Copy link
Member

absidue commented Oct 28, 2023

@Benjababe The blocking should be done using the channel ID, that way it will still work when the channel name changes.

@FreeTubeBot FreeTubeBot enabled auto-merge (squash) November 8, 2023 10:34
auto-merge was automatically disabled November 8, 2023 10:42

Head branch was pushed to by a user without write access

@FreeTubeBot FreeTubeBot enabled auto-merge (squash) November 8, 2023 10:42
auto-merge was automatically disabled November 8, 2023 11:03

Head branch was pushed to by a user without write access

@FreeTubeBot FreeTubeBot enabled auto-merge (squash) November 8, 2023 11:03
@kommunarr
Copy link
Collaborator

Thanks for the speedy work! But getting some errors now.
Screenshot_20231108_072820

auto-merge was automatically disabled November 8, 2023 15:06

Head branch was pushed to by a user without write access

@FreeTubeBot FreeTubeBot enabled auto-merge (squash) November 8, 2023 15:06
@Benjababe
Copy link
Contributor Author

My bad, forgot to check for tags without icons

@FreeTubeBot FreeTubeBot merged commit fcb2301 into FreeTubeApp:development Nov 9, 2023
6 checks passed
@github-actions github-actions bot removed the PR: waiting for review For PRs that are complete, tested, and ready for review label Nov 9, 2023
absidue added a commit to absidue/FreeTube that referenced this pull request Nov 9, 2023
FreeTubeBot pushed a commit that referenced this pull request Nov 11, 2023
* Add missing Electron guards after #4230

* Fix logic issue
PikachuEXE added a commit to PikachuEXE/FreeTube that referenced this pull request Nov 13, 2023
* development: (24 commits)
  Translated using Weblate (Arabic)
  Translated using Weblate (Ukrainian)
  Translated using Weblate (Polish)
  Translated using Weblate (French)
  Translated using Weblate (Greek)
  Translated using Weblate (Russian)
  Add missing Electron guards after FreeTubeApp#4230 (FreeTubeApp#4311)
  Translated using Weblate (Turkish)
  Translated using Weblate (Chinese (Traditional))
  Translated using Weblate (Portuguese)
  Translated using Weblate (Croatian)
  video id hash length to 4 (FreeTubeApp#4313)
  Translated using Weblate (Spanish)
  Translated using Weblate (Serbian)
  Translated using Weblate (Czech)
  Translated using Weblate (Italian)
  Translated using Weblate (Chinese (Simplified))
  Add identifiers to channels hidden by ID (FreeTubeApp#4230)
  Translated using Weblate (Japanese)
  Fixed order of elements to allow for proper tabbing in comments section (FreeTubeApp#4099)
  ...
kommunarr added a commit to PikachuEXE/FreeTube that referenced this pull request Nov 18, 2023
* add description option to hiding channels

* does channel id search

* add tag tooltip

* legacy support for hidden channels

* update removeTag

* add parenthesis to id name

* add icon and id checking before requesting

* update id regex

* decouple channel hidden from tags

* update handling for legacy hidden channels

* remove tag description

* formatting

* newline

* shorten retrieving hidden channels

* separate channel api requests

* refractor ft-input-tags.js

* replace secondaryName with preferredName for tags

* unify hidden channel name/icon retrieval function

* remove tooltip from ft-input-tags

* auto update hidden channel if ID was used

* remove hiding channel by name

* i18n channels hidden disabled message

* run auto hidden channel id update once

* Update src/renderer/components/ft-input-tags/ft-input-tags.vue

Co-authored-by: Jason <[email protected]>

* add text selection for ft tags

* add ft-input-tags icon url

* fix icon link

---------

Co-authored-by: Jason <[email protected]>
kommunarr pushed a commit to PikachuEXE/FreeTube that referenced this pull request Nov 18, 2023
* Add missing Electron guards after FreeTubeApp#4230

* Fix logic issue
kommunarr pushed a commit to PikachuEXE/FreeTube that referenced this pull request Nov 18, 2023
* development: (24 commits)
  Translated using Weblate (Arabic)
  Translated using Weblate (Ukrainian)
  Translated using Weblate (Polish)
  Translated using Weblate (French)
  Translated using Weblate (Greek)
  Translated using Weblate (Russian)
  Add missing Electron guards after FreeTubeApp#4230 (FreeTubeApp#4311)
  Translated using Weblate (Turkish)
  Translated using Weblate (Chinese (Traditional))
  Translated using Weblate (Portuguese)
  Translated using Weblate (Croatian)
  video id hash length to 4 (FreeTubeApp#4313)
  Translated using Weblate (Spanish)
  Translated using Weblate (Serbian)
  Translated using Weblate (Czech)
  Translated using Weblate (Italian)
  Translated using Weblate (Chinese (Simplified))
  Add identifiers to channels hidden by ID (FreeTubeApp#4230)
  Translated using Weblate (Japanese)
  Fixed order of elements to allow for proper tabbing in comments section (FreeTubeApp#4099)
  ...
kommunarr pushed a commit to PikachuEXE/FreeTube that referenced this pull request Nov 18, 2023
* development: (24 commits)
  Translated using Weblate (Arabic)
  Translated using Weblate (Ukrainian)
  Translated using Weblate (Polish)
  Translated using Weblate (French)
  Translated using Weblate (Greek)
  Translated using Weblate (Russian)
  Add missing Electron guards after FreeTubeApp#4230 (FreeTubeApp#4311)
  Translated using Weblate (Turkish)
  Translated using Weblate (Chinese (Traditional))
  Translated using Weblate (Portuguese)
  Translated using Weblate (Croatian)
  video id hash length to 4 (FreeTubeApp#4313)
  Translated using Weblate (Spanish)
  Translated using Weblate (Serbian)
  Translated using Weblate (Czech)
  Translated using Weblate (Italian)
  Translated using Weblate (Chinese (Simplified))
  Add identifiers to channels hidden by ID (FreeTubeApp#4230)
  Translated using Weblate (Japanese)
  Fixed order of elements to allow for proper tabbing in comments section (FreeTubeApp#4099)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature Request]: Resolve Channel ID for hidden channels
8 participants