1
0
mirror of https://github.com/TeamNewPipe/NewPipe synced 2025-06-28 16:13:02 +00:00

Truncate existing file in export

This commit is contained in:
Isira Seneviratne 2025-01-25 07:57:01 +05:30
parent af3ed992e5
commit 32a88ab890

View File

@ -46,7 +46,8 @@ class SubscriptionExportWorker(
setForeground(createForegroundInfo(title))
withContext(Dispatchers.IO) {
applicationContext.contentResolver.openOutputStream(uri)?.use {
// Truncate file if it already exists
applicationContext.contentResolver.openOutputStream(uri, "wt")?.use {
ImportExportJsonHelper.writeTo(subscriptions, it)
}
}