Skip to content

Commit 4d0d1eb

Browse files
committed
Dont refetch already existing libs
1 parent 10bf15d commit 4d0d1eb

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

beetsplug/ipfs.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -195,13 +195,14 @@ def ipfs_import(self, lib, args):
195195
self._log.error(msg)
196196
return False
197197
path = remote_libs + "/" + lib_name + ".db"
198-
cmd = "ipfs get {0} -o".format(_hash).split()
199-
cmd.append(path)
200-
try:
201-
util.command_output(cmd)
202-
except (OSError, subprocess.CalledProcessError):
203-
self._log.error("Could not import {0}".format(_hash))
204-
return False
198+
if not os.path.exists(path):
199+
cmd = "ipfs get {0} -o".format(_hash).split()
200+
cmd.append(path)
201+
try:
202+
util.command_output(cmd)
203+
except (OSError, subprocess.CalledProcessError):
204+
self._log.error("Could not import {0}".format(_hash))
205+
return False
205206

206207
# add all albums from remotes into a combined library
207208
jpath = remote_libs + "/joined.db"

0 commit comments

Comments
 (0)