From 9917f2ac3aa24e2e690ffb237c5a50434c164793 Mon Sep 17 00:00:00 2001 From: alicezou Date: Sun, 27 Mar 2022 09:56:47 -0400 Subject: [PATCH] create db without prompt --- beets/dbcore/db.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/beets/dbcore/db.py b/beets/dbcore/db.py index acd131be2..0e484d8ce 100755 --- a/beets/dbcore/db.py +++ b/beets/dbcore/db.py @@ -900,9 +900,15 @@ class Database: """The current revision of the database. To be increased whenever data is written in a transaction. """ + def _path_checker(self, path): + newpath = os.path.dirname(path) + if not os.path.isdir(newpath): + os.makedirs(newpath) + def __init__(self, path, timeout=5.0): self.path = path + self._path_checker(path) self.timeout = timeout self._connections = {}