Add 'public' torrent option to allow making a torrent publically viewable by other users
This commit is contained in:
parent
65c9dc5fa8
commit
33fd852bda
|
@ -140,7 +140,8 @@ DEFAULT_PREFS = {
|
||||||
"rate_limit_ip_overhead": True,
|
"rate_limit_ip_overhead": True,
|
||||||
"geoip_db_location": "/usr/share/GeoIP/GeoIP.dat",
|
"geoip_db_location": "/usr/share/GeoIP/GeoIP.dat",
|
||||||
"cache_size": 512,
|
"cache_size": 512,
|
||||||
"cache_expiry": 60
|
"cache_expiry": 60,
|
||||||
|
"public": False
|
||||||
}
|
}
|
||||||
|
|
||||||
class PreferencesManager(component.Component):
|
class PreferencesManager(component.Component):
|
||||||
|
|
|
@ -67,6 +67,7 @@ class TorrentOptions(dict):
|
||||||
"move_completed": "move_completed",
|
"move_completed": "move_completed",
|
||||||
"move_completed_path": "move_completed_path",
|
"move_completed_path": "move_completed_path",
|
||||||
"add_paused": "add_paused",
|
"add_paused": "add_paused",
|
||||||
|
"public": "public"
|
||||||
}
|
}
|
||||||
for opt_k, conf_k in options_conf_map.iteritems():
|
for opt_k, conf_k in options_conf_map.iteritems():
|
||||||
self[opt_k] = config[conf_k]
|
self[opt_k] = config[conf_k]
|
||||||
|
@ -602,6 +603,7 @@ class Torrent(object):
|
||||||
"paused": self.status.paused,
|
"paused": self.status.paused,
|
||||||
"prioritize_first_last": self.options["prioritize_first_last_pieces"],
|
"prioritize_first_last": self.options["prioritize_first_last_pieces"],
|
||||||
"progress": progress,
|
"progress": progress,
|
||||||
|
"public": self.options["public"],
|
||||||
"remove_at_ratio": self.options["remove_at_ratio"],
|
"remove_at_ratio": self.options["remove_at_ratio"],
|
||||||
"save_path": self.options["download_location"],
|
"save_path": self.options["download_location"],
|
||||||
"seeding_time": self.status.seeding_time,
|
"seeding_time": self.status.seeding_time,
|
||||||
|
|
|
@ -85,7 +85,8 @@ class TorrentState:
|
||||||
move_completed_path=None,
|
move_completed_path=None,
|
||||||
magnet=None,
|
magnet=None,
|
||||||
time_added=-1,
|
time_added=-1,
|
||||||
owner=None
|
owner=None,
|
||||||
|
public=False
|
||||||
):
|
):
|
||||||
self.torrent_id = torrent_id
|
self.torrent_id = torrent_id
|
||||||
self.filename = filename
|
self.filename = filename
|
||||||
|
@ -113,6 +114,7 @@ class TorrentState:
|
||||||
self.remove_at_ratio = remove_at_ratio
|
self.remove_at_ratio = remove_at_ratio
|
||||||
self.move_completed = move_completed
|
self.move_completed = move_completed
|
||||||
self.move_completed_path = move_completed_path
|
self.move_completed_path = move_completed_path
|
||||||
|
self.public = public
|
||||||
|
|
||||||
class TorrentManagerState:
|
class TorrentManagerState:
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
|
@ -358,6 +360,7 @@ class TorrentManager(component.Component):
|
||||||
options["move_completed"] = state.move_completed
|
options["move_completed"] = state.move_completed
|
||||||
options["move_completed_path"] = state.move_completed_path
|
options["move_completed_path"] = state.move_completed_path
|
||||||
options["add_paused"] = state.paused
|
options["add_paused"] = state.paused
|
||||||
|
options["public"] = state.public
|
||||||
|
|
||||||
ti = self.get_torrent_info_from_file(
|
ti = self.get_torrent_info_from_file(
|
||||||
os.path.join(get_config_dir(),
|
os.path.join(get_config_dir(),
|
||||||
|
|
Loading…
Reference in New Issue