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

This commit is contained in:
Andrew Resch 2010-08-21 12:25:05 -07:00
parent 65c9dc5fa8
commit 33fd852bda
3 changed files with 8 additions and 2 deletions

View File

@ -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):

View File

@ -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,

View File

@ -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(),