mirror of
https://github.com/beetbox/beets.git
synced 2025-12-26 18:43:38 +01:00
fix error when no logfile is given
This commit is contained in:
parent
76f52f9ea6
commit
c76ddd7da8
1 changed files with 3 additions and 1 deletions
|
|
@ -322,6 +322,8 @@ def import_files(lib, paths, copy=True, write=True, autot=True, logpath=None):
|
|||
"""
|
||||
if logpath:
|
||||
logfile = open(logpath, 'w')
|
||||
else:
|
||||
logfile = None
|
||||
|
||||
first = True
|
||||
for path in paths:
|
||||
|
|
@ -341,7 +343,7 @@ def import_files(lib, paths, copy=True, write=True, autot=True, logpath=None):
|
|||
lib.add(item)
|
||||
lib.save()
|
||||
|
||||
if logpath:
|
||||
if logfile:
|
||||
logfile.close()
|
||||
|
||||
def list_items(lib, query, album):
|
||||
|
|
|
|||
Loading…
Reference in a new issue