From c7894448f30e589b5752fb6f9d6e22c25984523e Mon Sep 17 00:00:00 2001
From: Chris Pomeroy <chris.pomeroy@hotmail.com>
Date: Fri, 23 Mar 2018 02:15:34 +0000
Subject: [PATCH] fixed white space issue

---
 aaxConvert.py |   18 ++++++++++++------
 1 files changed, 12 insertions(+), 6 deletions(-)

diff --git a/aaxConvert.py b/aaxConvert.py
index ae9567d..25a8614 100755
--- a/aaxConvert.py
+++ b/aaxConvert.py
@@ -7,6 +7,7 @@
 import json
 import requests
 from querysubsonic import findalbumbyname
+from time import sleep
 
 
 # arguments
@@ -138,11 +139,16 @@
 def getcorrectkey(aaxfile):
     hex = filechecksum(aaxfile)
     payload = hex
-    r = requests.post('http://x86-docker01:8080/function/checkkey', payload, verify=False)
-    if r.status_code == 200:
-        key = r.text
-    else: 
-        print('Checkkey function is down please wait')
+    recovery = 3
+    while recovery != 0:
+      r = requests.post('http://x86-docker01:8080/function/checkkey', payload, verify=False, timeout=None)
+      if r.status_code == 200:
+          key = r.text
+          recovery = 0
+      else: 
+          print('Checkkey function is down please wait')
+          recovery = recovery - 1
+          sleep(5)
     return key
 
 for rfile in glob.glob(args.filename):
@@ -155,7 +161,7 @@
             title = getmetadatatags('title')
             act_byte = getcorrectkey(rfile)
             ddir = "%s/%s/%s" % (path, artist, title)
-            single_file_path = "%s/%s.mp3" % (ddir, title)
+            single_file_path = "/processing/%s.mp3" % (title)
             if not os.path.exists(ddir):
                 os.makedirs(ddir)
             print(ddir)

--
Gitblit v1.10.0