Skip to content

Commit 32a88ab

Browse files
Truncate existing file in export
1 parent af3ed99 commit 32a88ab

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

app/src/main/java/org/schabi/newpipe/local/subscription/workers/SubscriptionExportWorker.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,8 @@ class SubscriptionExportWorker(
4646
setForeground(createForegroundInfo(title))
4747

4848
withContext(Dispatchers.IO) {
49-
applicationContext.contentResolver.openOutputStream(uri)?.use {
49+
// Truncate file if it already exists
50+
applicationContext.contentResolver.openOutputStream(uri, "wt")?.use {
5051
ImportExportJsonHelper.writeTo(subscriptions, it)
5152
}
5253
}

0 commit comments

Comments
 (0)