From d37feaff27dc5d420717b4b83f9e97c22539e02c Mon Sep 17 00:00:00 2001
From: angelblue05 <tamara.angel05@gmail.com>
Date: Thu, 27 Oct 2016 01:25:03 -0500
Subject: [PATCH] Upon reset, make sure we stop sync threads

---
 resources/lib/service_entry.py | 2 +-
 resources/lib/utils.py         | 1 +
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/resources/lib/service_entry.py b/resources/lib/service_entry.py
index 0de089e1..abbedfa9 100644
--- a/resources/lib/service_entry.py
+++ b/resources/lib/service_entry.py
@@ -218,7 +218,7 @@ class Service(object):
 
                 self.server_online = False
 
-            elif window('emby_online') == "sleep":
+            elif window('emby_online') in ("sleep", "reset"):
                 # device going to sleep
                 if self.websocket_running:
                     self.websocket_thread.stop_client()
diff --git a/resources/lib/utils.py b/resources/lib/utils.py
index 8a8d3c97..2ae07418 100644
--- a/resources/lib/utils.py
+++ b/resources/lib/utils.py
@@ -367,6 +367,7 @@ def reset():
         return
 
     # first stop any db sync
+    window('emby_online', value="reset")
     window('emby_shouldStop', value="true")
     count = 10
     while window('emby_dbScan') == "true":