diff --git a/client.py b/client.py index 490a8c2..82c3b4f 100755 --- a/client.py +++ b/client.py @@ -6,6 +6,7 @@ import json import os import pathlib import sys +import shutil from copy import deepcopy from datetime import datetime from random import randint @@ -84,7 +85,7 @@ class MunyalClient(Icon): # name="listener", # daemon=True) thread_uploader.start() - thread_downloader.start() + # thread_downloader.start() # thread_listener.start() self.run(self.__run) @@ -123,6 +124,7 @@ class MunyalClient(Icon): if data["name"] in self.ignored: self.ignored.remove(data["name"]) self.stack.pop(0) + continue if data["is_file"] and data["action"] == "add": full_path = os.path.join(folder, data["name"]) data["file"] = base64.b85encode( @@ -170,7 +172,8 @@ class MunyalClient(Icon): pass def downloader(self, data): - self.ignored.append(data["name"]) + name = data["name"] + self.ignored.append(name) full_path = os.path.join(self.config["folder"], name) if data["is_file"]: if data["action"] == "add": diff --git a/dir_to_json.py b/dir_to_json.py index 41cf6fd..b50e7a0 100644 --- a/dir_to_json.py +++ b/dir_to_json.py @@ -22,7 +22,7 @@ def get_json(path): items = os.listdir(path) try: for item in items: - if item[0] != ".": + if item[0] != "." and not item.endswith("tmp"): item_json = {"name": item} route = os.path.join(path, item) if os.path.isdir(route):