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

History OFF dumps tons of cache images/data to getExternalCacheDir() #10442

Open
6 tasks done
alpenamilch opened this issue Sep 22, 2023 · 12 comments
Open
6 tasks done

History OFF dumps tons of cache images/data to getExternalCacheDir() #10442

alpenamilch opened this issue Sep 22, 2023 · 12 comments
Labels
feature request Issue is related to a feature in the app history Anything to do with previously watched stuff privacy & data protection Issues regarding either NewPipe, Team NewPipe services or external services NewPipe uses

Comments

@alpenamilch
Copy link

alpenamilch commented Sep 22, 2023

Checklist

  • I made sure that there are no existing issues - open or closed - which I could contribute my information to.
  • I have read the FAQ and my problem isn't listed.
  • I'm aware that this is a request for NewPipe itself and that requests for adding a new service need to be made at NewPipeExtractor.
  • I have taken the time to fill in all the required details. I understand that the feature request will be dismissed otherwise.
  • This issue contains only one feature request.
  • I have read and understood the contribution guidelines.

Feature description

At the moment even with history OFF, tons of thumbnails/other video-data is dumped to getExternalCacheDir(). This is usually STORAGE/Android/data/org.schabi.newpipe. See This is accessible easily on an unlocked phone.

One possibility is to replace this

--- a/app/src/main/java/org/schabi/newpipe/player/helper/PlayerDataSource.java
+++ b/app/src/main/java/org/schabi/newpipe/player/helper/PlayerDataSource.java
@@ -200,7 +200,7 @@ public class PlayerDataSource {

     private static void instantiateCacheIfNeeded(final Context context) {
         if (cache == null) {
-            final File cacheDir = new File(context.getExternalCacheDir(), CACHE_FOLDER_NAME);
+            final File cacheDir = new File(context.getCacheDir(), CACHE_FOLDER_NAME);
             if (DEBUG) {
                 Log.d(TAG, "instantiateCacheIfNeeded: cacheDir = " + cacheDir.getAbsolutePath());
             }

This would mean instead of using /data/ - this is not easily accessible.

Why do you want this feature?

Privacy for viewer

Additional information

My idea would be

  • In the hamburger menu (left side) there is an incognito mode (in addition to Trending, subscriptions, WhatsNewm Bookmarks, Downloads
  • Once the user click on that incognito
  • One gets may be a clean view (and all those others disappear)
  • Now, anything search/view/play - is totally not cached/temp
  • Exit incognito. May be then it uses ExternalCacheStorage
incognito
@alpenamilch alpenamilch added feature request Issue is related to a feature in the app needs triage Issue is not yet ready for PR authors to take up labels Sep 22, 2023
@opusforlife2
Copy link
Collaborator

You could clear the app cache from the History menu after you're done using Newpipe?

@alpenamilch
Copy link
Author

alpenamilch commented Sep 22, 2023

Yes, I do agree. That is a good idea. Usually I go and clear everything from App->Info-> Clear all.

What I observe is that: I now have "Watch History" disabled - This gives a feeling I am in incognito but things are dumped to disk.

@opusforlife2
Copy link
Collaborator

I suppose we could have a setting below the Clear Cache button to "Always clear cache upon exiting Newpipe", or something to that effect.

@opusforlife2 opusforlife2 added privacy & data protection Issues regarding either NewPipe, Team NewPipe services or external services NewPipe uses history Anything to do with previously watched stuff and removed needs triage Issue is not yet ready for PR authors to take up labels Sep 22, 2023
@SameenAhnaf
Copy link
Collaborator

How is it different from #2338?

@opusforlife2
Copy link
Collaborator

The entire point of opening this issue is that cache data is being left behind despite history being off.

That issue is merely asking for a GUI convenience feature. This one is asking to tighten up data privacy.

@alpenamilch alpenamilch changed the title Create an incognito mode button in hamburger menu (left) History OFF dumps tons of cache images/data to getExternalCacheDir() Oct 17, 2023
@alpenamilch
Copy link
Author

by dev nulling the cache directory)

Which phone? In phones with 1-2 RAM, I have found not having cache directory causes the device to freeze a lot. (I mean works great on a > 8 GB RAM phone but...)

@alpenamilch
Copy link
Author

Try it on a Android Go device with 2GB eMMC - example Nokia 1.3 or Nokia 1.4 . If not using externalCacheDir - it dumps everything in /data/data or somewhere like that - this place is already having lots of things.

3 gig old device

like a flagship?

@alpenamilch
Copy link
Author

You are correct. I did not think of /dev/null from linux.

I thought you were talking about developers nulling it in builds or something like that.
Is it not possible to replace the getExternalCacheDir by /dev/null in code?

final File cacheDir = new File(context.getExternalCacheDir(), CACHE_FOLDER_NAME);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request Issue is related to a feature in the app history Anything to do with previously watched stuff privacy & data protection Issues regarding either NewPipe, Team NewPipe services or external services NewPipe uses
Projects
None yet
Development

No branches or pull requests

4 participants
@opusforlife2 @SameenAhnaf @alpenamilch and others