kuuko pushed a commit to branch master.

http://git.enlightenment.org/apps/epour.git/commit/?id=7433ec24833d00fdaf982d80cb70580a1f180a1b

commit 7433ec24833d00fdaf982d80cb70580a1f180a1b
Author: Kai Huuhko <kai.huu...@gmail.com>
Date:   Tue Aug 30 18:58:27 2016 +0300

    Fix restoring paused torrents to session
---
 epour/gui/TorrentSelector.py | 10 ++++++----
 epour/session.py             |  2 +-
 2 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/epour/gui/TorrentSelector.py b/epour/gui/TorrentSelector.py
index c55c3bf..48873b1 100644
--- a/epour/gui/TorrentSelector.py
+++ b/epour/gui/TorrentSelector.py
@@ -229,12 +229,14 @@ seed, this flag has no effect.'''
         self.add_dict["flags"] = (
             add_torrent_params_flags_t.flag_apply_ip_filter +
             add_torrent_params_flags_t.flag_update_subscribe +
-            add_torrent_params_flags_t.flag_duplicate_is_error +
-            add_torrent_params_flags_t.flag_auto_managed
-            )
+            add_torrent_params_flags_t.flag_duplicate_is_error)
 
         def option_flag_cb(c, flag):
-            self.add_dict["flags"] = self.add_dict["flags"] ^ flag
+            flags = self.add_dict["flags"]
+            flags = flags ^ flag
+            if flag == int(add_torrent_params_flags_t.flag_paused):
+                flags = flags ^ 
int(add_torrent_params_flags_t.flag_auto_managed)
+            self.add_dict["flags"] = flags
 
         for name, flag in sorted(add_torrent_params_flags_t.names.items()):
             if not int(flag) in self.names.keys():
diff --git a/epour/session.py b/epour/session.py
index 8acfedb..469f6f3 100644
--- a/epour/session.py
+++ b/epour/session.py
@@ -470,7 +470,7 @@ def status_to_flags(status):
     flags += 8 if status.share_mode else 0
     flags += 16 if status.ip_filter_applies else 0
     flags += 32 if status.paused else 0
-    flags += 64  # auto_managed
+    flags += 64  if status.auto_managed else 0
     flags += 128  # duplicate_is_error
     #flags += 256 deprecated
     flags += 512  # update_subscribe

-- 


Reply via email to