Module: deluge
Branch: master
Commit: 33fd852bdaec54887b5c529299e48910cb92ea6e

Author: Andrew Resch <[email protected]>
Date:   Sat Aug 21 12:25:05 2010 -0700

Add 'public' torrent option to allow making a torrent publically viewable by 
other users

---

 deluge/core/preferencesmanager.py |    3 ++-
 deluge/core/torrent.py            |    2 ++
 deluge/core/torrentmanager.py     |    5 ++++-
 3 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/deluge/core/preferencesmanager.py 
b/deluge/core/preferencesmanager.py
index 26e3759..6eb30ef 100644
--- a/deluge/core/preferencesmanager.py
+++ b/deluge/core/preferencesmanager.py
@@ -140,7 +140,8 @@ DEFAULT_PREFS = {
     "rate_limit_ip_overhead": True,
     "geoip_db_location": "/usr/share/GeoIP/GeoIP.dat",
     "cache_size": 512,
-    "cache_expiry": 60
+    "cache_expiry": 60,
+    "public": False
 }
 
 class PreferencesManager(component.Component):
diff --git a/deluge/core/torrent.py b/deluge/core/torrent.py
index ca2183d..99576f6 100644
--- a/deluge/core/torrent.py
+++ b/deluge/core/torrent.py
@@ -67,6 +67,7 @@ class TorrentOptions(dict):
                             "move_completed": "move_completed",
                             "move_completed_path": "move_completed_path",
                             "add_paused": "add_paused",
+                            "public": "public"
                            }
         for opt_k, conf_k in options_conf_map.iteritems():
             self[opt_k] = config[conf_k]
@@ -602,6 +603,7 @@ class Torrent(object):
             "paused": self.status.paused,
             "prioritize_first_last": 
self.options["prioritize_first_last_pieces"],
             "progress": progress,
+            "public": self.options["public"],
             "remove_at_ratio": self.options["remove_at_ratio"],
             "save_path": self.options["download_location"],
             "seeding_time": self.status.seeding_time,
diff --git a/deluge/core/torrentmanager.py b/deluge/core/torrentmanager.py
index f6edc2a..fddea5d 100644
--- a/deluge/core/torrentmanager.py
+++ b/deluge/core/torrentmanager.py
@@ -85,7 +85,8 @@ class TorrentState:
             move_completed_path=None,
             magnet=None,
             time_added=-1,
-            owner=None
+            owner=None,
+            public=False
         ):
         self.torrent_id = torrent_id
         self.filename = filename
@@ -113,6 +114,7 @@ class TorrentState:
         self.remove_at_ratio = remove_at_ratio
         self.move_completed = move_completed
         self.move_completed_path = move_completed_path
+        self.public = public
 
 class TorrentManagerState:
     def __init__(self):
@@ -358,6 +360,7 @@ class TorrentManager(component.Component):
             options["move_completed"] = state.move_completed
             options["move_completed_path"] = state.move_completed_path
             options["add_paused"] = state.paused
+            options["public"] = state.public
 
             ti = self.get_torrent_info_from_file(
                     os.path.join(get_config_dir(),

-- 
You received this message because you are subscribed to the Google Groups 
"deluge-commit" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/deluge-commit?hl=en.

Reply via email to