From f99d53a94e88aa5a58f8dae739c31c2c816aaa58 Mon Sep 17 00:00:00 2001 From: TransZAllen Date: Thu, 29 Jan 2026 12:00:00 +0800 Subject: [PATCH] [duplicated subtitle] Initialize subtitle cache directory for `SubtitleDeduplicator` - Configure cache directory as `/storage/emulated/0/Android/data//cache/subtitle_cache`, otherwise it will be 'null', and subtitle deduplication will be skipped. - Ensures this initialization is called before `checkAndDeduplicate()` in `SubtitleDeduplicator.java` (NewPipeExtractor). --- app/src/main/java/org/schabi/newpipe/util/StateSaver.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/src/main/java/org/schabi/newpipe/util/StateSaver.java b/app/src/main/java/org/schabi/newpipe/util/StateSaver.java index 61fdb602f..08175e7b3 100644 --- a/app/src/main/java/org/schabi/newpipe/util/StateSaver.java +++ b/app/src/main/java/org/schabi/newpipe/util/StateSaver.java @@ -31,6 +31,7 @@ import androidx.core.os.BundleCompat; import org.schabi.newpipe.BuildConfig; import org.schabi.newpipe.MainActivity; +import org.schabi.newpipe.extractor.utils.SubtitleDeduplicator; import java.io.File; import java.io.FileInputStream; @@ -70,6 +71,8 @@ public final class StateSaver { if (TextUtils.isEmpty(cacheDirPath)) { cacheDirPath = context.getCacheDir().getAbsolutePath(); } + + SubtitleDeduplicator.setCacheDirPath(cacheDirPath); } /**