From 4d0d1ebc7a370ce311bf48b1fdf149feeb9b0320 Mon Sep 17 00:00:00 2001 From: multikatt Date: Thu, 11 Jun 2015 00:08:01 -0400 Subject: [PATCH] Dont refetch already existing libs --- beetsplug/ipfs.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/beetsplug/ipfs.py b/beetsplug/ipfs.py index 78a2043db..8722e3593 100644 --- a/beetsplug/ipfs.py +++ b/beetsplug/ipfs.py @@ -195,13 +195,14 @@ class IPFSPlugin(BeetsPlugin): self._log.error(msg) return False path = remote_libs + "/" + lib_name + ".db" - cmd = "ipfs get {0} -o".format(_hash).split() - cmd.append(path) - try: - util.command_output(cmd) - except (OSError, subprocess.CalledProcessError): - self._log.error("Could not import {0}".format(_hash)) - return False + if not os.path.exists(path): + cmd = "ipfs get {0} -o".format(_hash).split() + cmd.append(path) + try: + util.command_output(cmd) + except (OSError, subprocess.CalledProcessError): + self._log.error("Could not import {0}".format(_hash)) + return False # add all albums from remotes into a combined library jpath = remote_libs + "/joined.db"