Skip to content

Commit f99d53a

Browse files
committed
[duplicated subtitle] Initialize subtitle cache directory for SubtitleDeduplicator
- Configure cache directory as `/storage/emulated/0/Android/data/<package_name>/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).
1 parent addf1e2 commit f99d53a

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

app/src/main/java/org/schabi/newpipe/util/StateSaver.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131

3232
import org.schabi.newpipe.BuildConfig;
3333
import org.schabi.newpipe.MainActivity;
34+
import org.schabi.newpipe.extractor.utils.SubtitleDeduplicator;
3435

3536
import java.io.File;
3637
import java.io.FileInputStream;
@@ -70,6 +71,8 @@ public static void init(final Context context) {
7071
if (TextUtils.isEmpty(cacheDirPath)) {
7172
cacheDirPath = context.getCacheDir().getAbsolutePath();
7273
}
74+
75+
SubtitleDeduplicator.setCacheDirPath(cacheDirPath);
7376
}
7477

7578
/**

0 commit comments

Comments
 (0)