This commit is contained in:
LagradOst 2022-02-07 01:05:21 +01:00
parent ae6dfe6a49
commit c191d16b01

View file

@ -1055,6 +1055,16 @@ object VideoDownloadManager {
): Int { ): Int {
val displayName = getDisplayName(name, extension) val displayName = getDisplayName(name, extension)
// delete all subtitle files
if (extension == "mp4") {
try {
delete(context, name, folder, "vtt", parentId, basePath)
delete(context, name, folder, "srt", parentId, basePath)
} catch (e: Exception) {
logError(e)
}
}
// If scoped storage and using download dir (not accessible with UniFile) // If scoped storage and using download dir (not accessible with UniFile)
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q && basePath.isDownloadDir()) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q && basePath.isDownloadDir()) {
val relativePath = getRelativePath(folder) val relativePath = getRelativePath(folder)