FreeTube icon indicating copy to clipboard operation
FreeTube copied to clipboard

Don't fetch additional data when importing subscriptions

Open ChunkyProgrammer opened this issue 2 years ago • 29 comments

Don't fetch additional data when importing subscriptions

Pull Request Type

  • [x] Bugfix
  • [x] Feature Implementation

Related issue

  • Avoids rate limit when importing subscriptions
  • closes https://github.com/FreeTubeApp/FreeTube/issues/3943

Description

This PR will load the subscriptions as is and will load data only when needed (thumbnails will be slowly loaded in the side bar if channels are set to be displayed there). If someone disables the sidebar and doesn't use the Subscribed Channels page then thumbnails will be added when a user navigates to a channel.

Testing

See: https://github.com/FreeTubeApp/FreeTube/issues/3735#issuecomment-1642286050

Change file extension .txt to .db

(Notice how much faster importing subscriptions is)

Desktop

  • OS: Windows
  • OS Version: 10
  • FreeTube version: 0.19.1

ChunkyProgrammer avatar Nov 16 '23 04:11 ChunkyProgrammer

issue (non-blocking): Minor z-index issue on the tooltip.

Screenshot_20231116_223657

kommunarr avatar Nov 17 '23 04:11 kommunarr

issue (blocking): The tooltip text could use a bit more clarity on the implications of the choice & what exactly is at stake (pros and/or cons). As a user, the tooltip opens up more questions for me than it answers.

question: I'm also missing some context on the intention of this change. Is this more of a temporary workaround to that issue, a longer-term workaround because that issue has no clear fix, a way to reduce requests that is worthy as a feature on its own merits, or some mix of the three? A clearer tooltip as mentioned above would clear up my confusion.

kommunarr avatar Nov 17 '23 04:11 kommunarr

issue (blocking): The tooltip text could use a bit more clarity on the implications of the choice & what exactly is at stake (pros and/or cons). As a user, the tooltip opens up more questions for me than it answers.

question: I'm also missing some context on the intention of this change. Is this more of a temporary workaround to that issue, a longer-term workaround because that issue has no clear fix, a way to reduce requests that is worthy as a feature on its own merits, or some mix of the three? A clearer tooltip as mentioned above would clear up my confusion.

The main purpose is to avoid rate limiting when importing subscriptions from other sources (invidious, newpipe, youtube) but disabling the toggle also fixes other issues for channels that are age restricted, deleted, etc. as we handle that logic on the subscription page already. It also greatly improves the speed of importing subscriptions.

Now that I think about it, I wonder if I should just remove the prompt and not make any extra requests during the import at all.

ChunkyProgrammer avatar Nov 17 '23 17:11 ChunkyProgrammer

One worry I have with adding the thumbnail fetching to the side bar, is that we might just be moving the ratelimiting problem to the side bar. #4231 will make the problem worse though as it allows you to display up to 5 columns of channels in the sidebar at the same time.

Another option instead of doign nothing is doing a much smaller number of requests e.g. maximum 50 requests, that way it won't get ratelimited but it'll still be able to show thumbnails for a bunch of channels straight away.

Also it should probably be made more robust so it can actually skip deleted/removed channels without aborting the whole import process.

absidue avatar Nov 20 '23 22:11 absidue

If we can avoid fetching data that would probably be best.

absidue avatar Nov 21 '23 16:11 absidue

If we can avoid fetching data that would probably be best.

Sounds good, I'll most likely update it this weekend to avoid fetching the data

ChunkyProgrammer avatar Nov 21 '23 17:11 ChunkyProgrammer

Could this fix https://github.com/FreeTubeApp/FreeTube/issues/3211#issuecomment-1439345844?

Sounds like it would introduce the same issue to the side bar, that said comment mentions on the subscribed channels page, the the logic to fetch the thumbnails from the API when it's missing was copied/inspired from there.

absidue avatar Nov 25 '23 23:11 absidue

Could this fix #3211 (comment)?

I can't seem to reproduce that error, so it might be fixed or it might be a bit more complex

ChunkyProgrammer avatar Nov 26 '23 14:11 ChunkyProgrammer

issue (very minor, non-blocking): When the channel thumbnail fails to load, it still shows something ugly for a few seconds until it corrects itself.

The thumbnail failing to load is what's used for FreeTube to correct itself, I'm not sure if there's a better way to handle it than by failing to load an image and then making a request to get an image when it fails

ChunkyProgrammer avatar Nov 27 '23 01:11 ChunkyProgrammer

Right now it seems that the new version relies on invalid url and error handler to update thumbnail URLs To properly fix this a default image (URL) needs to be displayed and a handler (on show?) to conditionally update the thumbnail Not sure if it's quick to implement

PikachuEXE avatar Nov 27 '23 01:11 PikachuEXE

Default image should now be shown when importing and constants are now used image

ChunkyProgrammer avatar Nov 27 '23 03:11 ChunkyProgrammer

If this is meant to address the issue I mentioned earlier, still seeing it: Screenshot_20231126_213024

Still fine if this goes unfixed as it's pretty minor, just wanted to communicate that.

kommunarr avatar Nov 27 '23 03:11 kommunarr

I don't know how to see loading-spinner icon at all If I am offline the side bar just shows images as missing

How I test offline image

PikachuEXE avatar Nov 28 '23 00:11 PikachuEXE

Side nav looks the same as before, but everything seems to be working fine. Still haven't seen the loading spinner or the profile font-awesome-icon.

kommunarr avatar Nov 28 '23 22:11 kommunarr

This pull request has conflicts, please resolve those before we can evaluate the pull request.

github-actions[bot] avatar Jan 03 '24 18:01 github-actions[bot]

Conflicts have been resolved. A maintainer will review the pull request shortly.

github-actions[bot] avatar Jan 03 '24 20:01 github-actions[bot]

This pull request has conflicts, please resolve those before we can evaluate the pull request.

github-actions[bot] avatar Jan 11 '24 17:01 github-actions[bot]

Conflicts have been resolved. A maintainer will review the pull request shortly.

github-actions[bot] avatar Jan 13 '24 05:01 github-actions[bot]

  1. Isnt this a bit user unfriendly behavior? User needs to go to every channel to make the loading icons disappear. With this example it isnt a big task but with 100+ that becomes quite a chore

https://github.com/FreeTubeApp/FreeTube/assets/73130443/b35b9c1c-08b5-4dda-9eda-ae29214b86f1

  1. why no loading icon here?

https://github.com/FreeTubeApp/FreeTube/assets/73130443/d2eadacb-b628-40c6-a30b-5b3a8e422c11

Test files work for me (see loading icon) But should that work for FT sub DB files too?

PikachuEXE avatar Jan 30 '24 01:01 PikachuEXE

  1. Isnt this a bit user unfriendly behavior? User needs to go to every channel to make the loading icons disappear. With this example it isnt a big task but with 100+ that becomes quite a chore

VirtualBoxVM_atyrwtVaTk.mp4 2. why no loading icon here?

VirtualBoxVM_P5DAk8PIIE.mp4

You seem to have a lot of errors in the console, could you send a screenshot of them?

ChunkyProgrammer avatar Jan 30 '24 02:01 ChunkyProgrammer

@ChunkyProgrammer apologies about the previous video, there seems to be a mistake on my end.

New testing has discovered the following:

  1. On clean startup channel icons load when imported but if you remove channels and import again channel icons wont load

https://github.com/FreeTubeApp/FreeTube/assets/73130443/89c201f7-de1b-48bf-8fa5-231adfa954c4

  1. After importing freetube-subscriptions.json, most of the subs loaded fast but there a quite a few that are spinning forever

https://github.com/FreeTubeApp/FreeTube/assets/73130443/b9533036-4ffc-4e17-b1a9-203e29f4fb4a

  1. Is this still something that you want to address?

issue (very minor, non-blocking): When the channel thumbnail fails to load, it still shows something ugly for a few seconds until it corrects itself.

The thumbnail failing to load is what's used for FreeTube to correct itself, I'm not sure if there's a better way to handle it than by failing to load an image and then making a request to get an image when it fails

  1. FT doesnt seem to be happy about me visiting the profile page.

https://github.com/FreeTubeApp/FreeTube/assets/73130443/c4e60294-9439-40ee-8a2e-14c441272474

This pull request has conflicts, please resolve those before we can evaluate the pull request.

github-actions[bot] avatar Feb 16 '24 21:02 github-actions[bot]

Conflicts have been resolved. A maintainer will review the pull request shortly.

github-actions[bot] avatar Feb 19 '24 00:02 github-actions[bot]

This pull request has conflicts, please resolve those before we can evaluate the pull request.

github-actions[bot] avatar Feb 23 '24 15:02 github-actions[bot]

Conflicts have been resolved. A maintainer will review the pull request shortly.

github-actions[bot] avatar Mar 08 '24 01:03 github-actions[bot]

This pull request has conflicts, please resolve those before we can evaluate the pull request.

github-actions[bot] avatar Mar 13 '24 06:03 github-actions[bot]

Conflicts have been resolved. A maintainer will review the pull request shortly.

github-actions[bot] avatar Mar 13 '24 20:03 github-actions[bot]

This pull request has conflicts, please resolve those before we can evaluate the pull request.

github-actions[bot] avatar Apr 07 '24 15:04 github-actions[bot]