Fix ensureDbDirectoryExists

This commit is contained in:
XiangRongLin 2020-12-19 16:53:11 +01:00
parent af119db1d7
commit fcfdcd1025
2 changed files with 21 additions and 2 deletions

View file

@ -45,10 +45,9 @@ class ContentSettingsManager(private val fileLocator: NewPipeFileLocator) {
* @return Whether the directory exists afterwards.
*/
fun ensureDbDirectoryExists(): Boolean {
return !fileLocator.dbDir.exists() && !fileLocator.dbDir.mkdir()
return fileLocator.dbDir.exists() || fileLocator.dbDir.mkdir()
}
fun extractDb(filePath: String): Boolean {
val success = ZipHelper.extractFileFromZip(filePath, fileLocator.db.path, "newpipe.db")
if (success) {