mirror of https://github.com/evilhero/mylar
Merge branch 'development'
This commit is contained in:
commit
34e540c75f
|
@ -92,7 +92,7 @@
|
|||
<small>
|
||||
<a href="shutdown"><span class="ui-button-icon-primary ui-icon ui-icon-power"></span>Shutdown</a> |
|
||||
<a href="restart"><span class="ui-button-icon-primary ui-icon ui-icon-power"></span>Restart</a> |
|
||||
<a href="/auth/logout"><span class="ui-button-icon-primary ui-icon ui-icon-power"></span>Logout</a></br>
|
||||
<a href="auth/logout"><span class="ui-button-icon-primary ui-icon ui-icon-power"></span>Logout</a></br>
|
||||
<a href="#" onclick="doAjaxCall('checkGithub',$(this))" data-success="Checking for update successful" data-error="Error checking for update"><span class="ui-icon ui-icon-refresh"></span>Check for new version</a>
|
||||
</small>
|
||||
</div>
|
||||
|
|
|
@ -1158,7 +1158,11 @@
|
|||
</div>
|
||||
<div class="row">
|
||||
<label>Folder Format</label>
|
||||
<input type="text" title="$Publisher, $Series, $Year" name="folder_format" value="${config['folder_format']}" size="43">
|
||||
<input type="text" name="folder_format" value="${config['folder_format']}" size="43">
|
||||
<%
|
||||
folder_options = "$Series = SeriesName\n$Year = SeriesYear\n$Annual = Annual (word)\n$VolumeY = V{SeriesYear}\n$VolumeN = V{Volume#}"
|
||||
%>
|
||||
<a href="#" title="${folder_options}"><img src="interfaces/default/images/info32.png" height="16" alt="" /></a>
|
||||
<small>Use: $Publisher, $Series, $Year<br />
|
||||
E.g.: $Publisher/$Series ($Year) = DC Comics/Action Comics (2011)</small>
|
||||
</div>
|
||||
|
@ -1166,7 +1170,7 @@
|
|||
<label> File Format</label>
|
||||
<input type="text" name="file_format" value="${config['file_format']}" size="43">
|
||||
<%
|
||||
file_options = "$Series = SeriesName\n$Year = SeriesYear\n$Annual = Annual (word)\n$Issue = IssueNumber\n$VolumeY = V{SeriesYear}\n$VolumeN = V{Volume#}\n$month = publication month number\n$monthname = publication month name"
|
||||
file_options = "$Series = SeriesName\n$Year = IssueYear\n$Annual = Annual (word)\n$Issue = IssueNumber\n$VolumeY = V{SeriesYear}\n$VolumeN = V{Volume#}\n$month = publication month number\n$monthname = publication month name"
|
||||
%>
|
||||
<a href="#" title="${file_options}"><img src="interfaces/default/images/info32.png" height="16" alt="" /></a>
|
||||
<small>Use: $Series, $Year, $Issue<br />
|
||||
|
|
|
@ -74,8 +74,13 @@ class RTorrent:
|
|||
if m.is_retriever() and m.is_available(self)]
|
||||
|
||||
m = rtorrent.rpc.Multicall(self)
|
||||
m.add("d.multicall", view, "d.get_hash=",
|
||||
*[method.rpc_call + "=" for method in retriever_methods])
|
||||
if Connection._get_client_version_tuple >= .97:
|
||||
MCFirstArg = ""
|
||||
m.add("d.multicall2", MCFirstArg, view, "d.hash=",
|
||||
*[method.rpc_call + "=" for method in retriever_methods])
|
||||
else:
|
||||
m.add("d.multicall", view, "d.get_hash=",
|
||||
*[method.rpc_call + "=" for method in retriever_methods])
|
||||
|
||||
results = m.call()[0] # only sent one call, only need first result
|
||||
|
||||
|
@ -116,16 +121,31 @@ class RTorrent:
|
|||
elif verbose:
|
||||
func_name = "load_verbose"
|
||||
else:
|
||||
func_name = "load"
|
||||
if Connection._get_client_version_tuple >= .97:
|
||||
func_name= "load.normal"
|
||||
else:
|
||||
func_name = "load"
|
||||
elif file_type in ["file", "raw"]:
|
||||
if start and verbose:
|
||||
func_name = "load_raw_start_verbose"
|
||||
if Connection._get_client_version_tuple >= .97:
|
||||
func_name = "load.raw_start_verbose"
|
||||
else:
|
||||
func_name = "load_raw_start_verbose"
|
||||
elif start:
|
||||
func_name = "load_raw_start"
|
||||
if Connection._get_client_version_tuple >= .97:
|
||||
func_name = "load.raw_start"
|
||||
else:
|
||||
func_name = "load_raw_start"
|
||||
elif verbose:
|
||||
func_name = "load_raw_verbose"
|
||||
if Connection._get_client_version_tuple >= .97:
|
||||
func_name = "load.raw_verbose"
|
||||
else:
|
||||
func_name = "load_raw_verbose"
|
||||
else:
|
||||
func_name = "load_raw"
|
||||
if Connection._get_client_version_tuple >= .97:
|
||||
func_name = "load.raw"
|
||||
else:
|
||||
func_name = "load_raw"
|
||||
|
||||
return(func_name)
|
||||
|
||||
|
@ -136,39 +156,79 @@ class RTorrent:
|
|||
info_hash = info_hash.upper()
|
||||
|
||||
func_name = self._get_load_function("url", start, verbose)
|
||||
|
||||
# load magnet
|
||||
getattr(p, func_name)(magneturl)
|
||||
if Connection._get_client_version_tuple >= .97:
|
||||
target = ""
|
||||
getattr(p, func_name)(target, magneturl)
|
||||
else:
|
||||
getattr(p, func_name)(magneturl)
|
||||
|
||||
magnet = False
|
||||
if verify_load:
|
||||
i = 0
|
||||
torrent = None
|
||||
while i < verify_retries:
|
||||
for tor in self.get_torrents():
|
||||
if tor.info_hash != info_hash:
|
||||
continue
|
||||
else:
|
||||
torrent = tor
|
||||
if Connection._get_client_version_tuple >= .97:
|
||||
for m in self.get_torrents():
|
||||
# This block finds the magnet that was just added, starts it, breaks
|
||||
# out of the for loop, and then out of the while loop.
|
||||
# If it can't find the magnet, magnet won't get defined.
|
||||
if m.info_hash == info_hash:
|
||||
magnet = m
|
||||
magnet.start()
|
||||
i += 999
|
||||
break
|
||||
else:
|
||||
for tor in self.get_torrents():
|
||||
if tor.info_hash != info_hash:
|
||||
continue
|
||||
else:
|
||||
torrent = tor
|
||||
break
|
||||
if torrent is not None:
|
||||
break
|
||||
if torrent is not None:
|
||||
break
|
||||
time.sleep(1)
|
||||
i += 1
|
||||
|
||||
if Connection._get_client_version_tuple >= .97:
|
||||
# If torrent hasn't been defined, sleep for a second and check again.
|
||||
if not magnet:
|
||||
time.sleep(1)
|
||||
i += 1
|
||||
|
||||
# This bit waits for the magnet to be resolved into an actual
|
||||
# torrent, and then starts it.
|
||||
torrent = False
|
||||
else:
|
||||
# Resolve magnet to torrent
|
||||
torrent.start()
|
||||
|
||||
assert info_hash in [t.info_hash for t in self.torrents],\
|
||||
"Adding magnet was unsuccessful."
|
||||
|
||||
i = 0
|
||||
while i < verify_retries:
|
||||
i = 0
|
||||
while i < verify_retries:
|
||||
if Connection._get_client_version_tuple >= .97:
|
||||
for t in self.get_torrents():
|
||||
if t.info_hash == info_hash:
|
||||
if str(info_hash) not in str(t.name):
|
||||
torrent = t
|
||||
torrent.start()
|
||||
i += 999
|
||||
break
|
||||
if not torrent:
|
||||
time.sleep(1)
|
||||
i += 1
|
||||
|
||||
else:
|
||||
for torrent in self.get_torrents():
|
||||
if torrent.info_hash == info_hash:
|
||||
if str(info_hash) not in str(torrent.name):
|
||||
time.sleep(1)
|
||||
i += 1
|
||||
|
||||
if Connection._get_client_version_tuple >= .97:
|
||||
assert info_hash in [t.info_hash for t in self.torrents],\
|
||||
"Adding magnet was unsuccessful."
|
||||
|
||||
return(torrent)
|
||||
|
||||
def load_torrent(self, torrent, start=False, verbose=False, verify_load=True, verify_retries=3):
|
||||
|
@ -213,7 +273,11 @@ class RTorrent:
|
|||
func_name = self._get_load_function("raw", start, verbose)
|
||||
|
||||
# load torrent
|
||||
getattr(p, func_name)(torrent)
|
||||
if Connection._get_client_version_tuple >= .97:
|
||||
target = ""
|
||||
getattr(p, func_name)(target, torrent)
|
||||
else:
|
||||
getattr(p, func_name)(torrent)
|
||||
|
||||
if verify_load:
|
||||
i = 0
|
||||
|
|
|
@ -57,35 +57,66 @@ class File:
|
|||
def __repr__(self):
|
||||
return safe_repr("File(index={0} path=\"{1}\")", self.index, self.path)
|
||||
|
||||
methods = [
|
||||
# RETRIEVERS
|
||||
Method(File, 'get_last_touched', 'f.get_last_touched'),
|
||||
Method(File, 'get_range_second', 'f.get_range_second'),
|
||||
Method(File, 'get_size_bytes', 'f.get_size_bytes'),
|
||||
Method(File, 'get_priority', 'f.get_priority'),
|
||||
Method(File, 'get_match_depth_next', 'f.get_match_depth_next'),
|
||||
Method(File, 'is_resize_queued', 'f.is_resize_queued',
|
||||
boolean=True,
|
||||
),
|
||||
Method(File, 'get_range_first', 'f.get_range_first'),
|
||||
Method(File, 'get_match_depth_prev', 'f.get_match_depth_prev'),
|
||||
Method(File, 'get_path', 'f.get_path'),
|
||||
Method(File, 'get_completed_chunks', 'f.get_completed_chunks'),
|
||||
Method(File, 'get_path_components', 'f.get_path_components'),
|
||||
Method(File, 'is_created', 'f.is_created',
|
||||
boolean=True,
|
||||
),
|
||||
Method(File, 'is_open', 'f.is_open',
|
||||
boolean=True,
|
||||
),
|
||||
Method(File, 'get_size_chunks', 'f.get_size_chunks'),
|
||||
Method(File, 'get_offset', 'f.get_offset'),
|
||||
Method(File, 'get_frozen_path', 'f.get_frozen_path'),
|
||||
Method(File, 'get_path_depth', 'f.get_path_depth'),
|
||||
Method(File, 'is_create_queued', 'f.is_create_queued',
|
||||
boolean=True,
|
||||
),
|
||||
|
||||
|
||||
# MODIFIERS
|
||||
]
|
||||
if rtorrent.connection.Connection._get_client_version_tuple >= .97:
|
||||
methods = [
|
||||
# RETRIEVERS
|
||||
Method(File, 'get_last_touched', 'f.last_touched'),
|
||||
Method(File, 'get_range_second', 'f.range_second'),
|
||||
Method(File, 'get_size_bytes', 'f.size_bytes'),
|
||||
Method(File, 'get_priority', 'f.priority'),
|
||||
Method(File, 'get_match_depth_next', 'f.match_depth_next'),
|
||||
Method(File, 'is_resize_queued', 'f.is_resize_queued',
|
||||
boolean=True,
|
||||
),
|
||||
Method(File, 'get_range_first', 'f.range_first'),
|
||||
Method(File, 'get_match_depth_prev', 'f.match_depth_prev'),
|
||||
Method(File, 'get_path', 'f.path'),
|
||||
Method(File, 'get_completed_chunks', 'f.completed_chunks'),
|
||||
Method(File, 'get_path_components', 'f.path_components'),
|
||||
Method(File, 'is_created', 'f.is_created',
|
||||
boolean=True,
|
||||
),
|
||||
Method(File, 'is_open', 'f.is_open',
|
||||
boolean=True,
|
||||
),
|
||||
Method(File, 'get_size_chunks', 'f.size_chunks'),
|
||||
Method(File, 'get_offset', 'f.offset'),
|
||||
Method(File, 'get_frozen_path', 'f.frozen_path'),
|
||||
Method(File, 'get_path_depth', 'f.path_depth'),
|
||||
Method(File, 'is_create_queued', 'f.is_create_queued',
|
||||
boolean=True,
|
||||
),
|
||||
# MODIFIERS
|
||||
]
|
||||
else:
|
||||
methods = [
|
||||
# RETRIEVERS
|
||||
Method(File, 'get_last_touched', 'f.get_last_touched'),
|
||||
Method(File, 'get_range_second', 'f.get_range_second'),
|
||||
Method(File, 'get_size_bytes', 'f.get_size_bytes'),
|
||||
Method(File, 'get_priority', 'f.get_priority'),
|
||||
Method(File, 'get_match_depth_next', 'f.get_match_depth_next'),
|
||||
Method(File, 'is_resize_queued', 'f.is_resize_queued',
|
||||
boolean=True,
|
||||
),
|
||||
Method(File, 'get_range_first', 'f.get_range_first'),
|
||||
Method(File, 'get_match_depth_prev', 'f.get_match_depth_prev'),
|
||||
Method(File, 'get_path', 'f.get_path'),
|
||||
Method(File, 'get_completed_chunks', 'f.get_completed_chunks'),
|
||||
Method(File, 'get_path_components', 'f.get_path_components'),
|
||||
Method(File, 'is_created', 'f.is_created',
|
||||
boolean=True,
|
||||
),
|
||||
Method(File, 'is_open', 'f.is_open',
|
||||
boolean=True,
|
||||
),
|
||||
Method(File, 'get_size_chunks', 'f.get_size_chunks'),
|
||||
Method(File, 'get_offset', 'f.get_offset'),
|
||||
Method(File, 'get_frozen_path', 'f.get_frozen_path'),
|
||||
Method(File, 'get_path_depth', 'f.get_path_depth'),
|
||||
Method(File, 'is_create_queued', 'f.is_create_queued',
|
||||
boolean=True,
|
||||
),
|
||||
# MODIFIERS
|
||||
]
|
||||
|
|
|
@ -55,44 +55,88 @@ class Peer:
|
|||
|
||||
multicall.call()
|
||||
|
||||
methods = [
|
||||
# RETRIEVERS
|
||||
Method(Peer, 'is_preferred', 'p.is_preferred',
|
||||
boolean=True,
|
||||
),
|
||||
Method(Peer, 'get_down_rate', 'p.get_down_rate'),
|
||||
Method(Peer, 'is_unwanted', 'p.is_unwanted',
|
||||
boolean=True,
|
||||
),
|
||||
Method(Peer, 'get_peer_total', 'p.get_peer_total'),
|
||||
Method(Peer, 'get_peer_rate', 'p.get_peer_rate'),
|
||||
Method(Peer, 'get_port', 'p.get_port'),
|
||||
Method(Peer, 'is_snubbed', 'p.is_snubbed',
|
||||
boolean=True,
|
||||
),
|
||||
Method(Peer, 'get_id_html', 'p.get_id_html'),
|
||||
Method(Peer, 'get_up_rate', 'p.get_up_rate'),
|
||||
Method(Peer, 'is_banned', 'p.banned',
|
||||
boolean=True,
|
||||
),
|
||||
Method(Peer, 'get_completed_percent', 'p.get_completed_percent'),
|
||||
Method(Peer, 'completed_percent', 'p.completed_percent'),
|
||||
Method(Peer, 'get_id', 'p.get_id'),
|
||||
Method(Peer, 'is_obfuscated', 'p.is_obfuscated',
|
||||
boolean=True,
|
||||
),
|
||||
Method(Peer, 'get_down_total', 'p.get_down_total'),
|
||||
Method(Peer, 'get_client_version', 'p.get_client_version'),
|
||||
Method(Peer, 'get_address', 'p.get_address'),
|
||||
Method(Peer, 'is_incoming', 'p.is_incoming',
|
||||
boolean=True,
|
||||
),
|
||||
Method(Peer, 'is_encrypted', 'p.is_encrypted',
|
||||
boolean=True,
|
||||
),
|
||||
Method(Peer, 'get_options_str', 'p.get_options_str'),
|
||||
Method(Peer, 'get_client_version', 'p.client_version'),
|
||||
Method(Peer, 'get_up_total', 'p.get_up_total'),
|
||||
if rtorrent.connection.Connection._get_client_version_tuple >= .97:
|
||||
methods = [
|
||||
# RETRIEVERS
|
||||
Method(Peer, 'is_preferred', 'p.is_preferred',
|
||||
boolean=True,
|
||||
),
|
||||
Method(Peer, 'get_down_rate', 'p.down_rate'),
|
||||
Method(Peer, 'is_unwanted', 'p.is_unwanted',
|
||||
boolean=True,
|
||||
),
|
||||
Method(Peer, 'get_peer_total', 'p.peer_total'),
|
||||
Method(Peer, 'get_peer_rate', 'p.peer_rate'),
|
||||
Method(Peer, 'get_port', 'p.port'),
|
||||
Method(Peer, 'is_snubbed', 'p.is_snubbed',
|
||||
boolean=True,
|
||||
),
|
||||
Method(Peer, 'get_id_html', 'p.id_html'),
|
||||
Method(Peer, 'get_up_rate', 'p.up_rate'),
|
||||
Method(Peer, 'is_banned', 'p.banned',
|
||||
boolean=True,
|
||||
),
|
||||
Method(Peer, 'get_completed_percent', 'p.completed_percent'),
|
||||
Method(Peer, 'completed_percent', 'p.completed_percent'),
|
||||
Method(Peer, 'get_id', 'p.id'),
|
||||
Method(Peer, 'is_obfuscated', 'p.is_obfuscated',
|
||||
boolean=True,
|
||||
),
|
||||
Method(Peer, 'get_down_total', 'p.down_total'),
|
||||
Method(Peer, 'get_client_version', 'p.client_version'),
|
||||
Method(Peer, 'get_address', 'p.address'),
|
||||
Method(Peer, 'is_incoming', 'p.is_incoming',
|
||||
boolean=True,
|
||||
),
|
||||
Method(Peer, 'is_encrypted', 'p.is_encrypted',
|
||||
boolean=True,
|
||||
),
|
||||
Method(Peer, 'get_options_str', 'p.options_str'),
|
||||
Method(Peer, 'get_client_version', 'p.client_version'),
|
||||
Method(Peer, 'get_up_total', 'p.up_total'),
|
||||
|
||||
# MODIFIERS
|
||||
]
|
||||
else:
|
||||
methods = [
|
||||
# RETRIEVERS
|
||||
Method(Peer, 'is_preferred', 'p.is_preferred',
|
||||
boolean=True,
|
||||
),
|
||||
Method(Peer, 'get_down_rate', 'p.get_down_rate'),
|
||||
Method(Peer, 'is_unwanted', 'p.is_unwanted',
|
||||
boolean=True,
|
||||
),
|
||||
Method(Peer, 'get_peer_total', 'p.get_peer_total'),
|
||||
Method(Peer, 'get_peer_rate', 'p.get_peer_rate'),
|
||||
Method(Peer, 'get_port', 'p.get_port'),
|
||||
Method(Peer, 'is_snubbed', 'p.is_snubbed',
|
||||
boolean=True,
|
||||
),
|
||||
Method(Peer, 'get_id_html', 'p.get_id_html'),
|
||||
Method(Peer, 'get_up_rate', 'p.get_up_rate'),
|
||||
Method(Peer, 'is_banned', 'p.banned',
|
||||
boolean=True,
|
||||
),
|
||||
Method(Peer, 'get_completed_percent', 'p.get_completed_percent'),
|
||||
Method(Peer, 'completed_percent', 'p.completed_percent'),
|
||||
Method(Peer, 'get_id', 'p.get_id'),
|
||||
Method(Peer, 'is_obfuscated', 'p.is_obfuscated',
|
||||
boolean=True,
|
||||
),
|
||||
Method(Peer, 'get_down_total', 'p.get_down_total'),
|
||||
Method(Peer, 'get_client_version', 'p.get_client_version'),
|
||||
Method(Peer, 'get_address', 'p.get_address'),
|
||||
Method(Peer, 'is_incoming', 'p.is_incoming',
|
||||
boolean=True,
|
||||
),
|
||||
Method(Peer, 'is_encrypted', 'p.is_encrypted',
|
||||
boolean=True,
|
||||
),
|
||||
Method(Peer, 'get_options_str', 'p.get_options_str'),
|
||||
Method(Peer, 'get_client_version', 'p.client_version'),
|
||||
Method(Peer, 'get_up_total', 'p.get_up_total'),
|
||||
|
||||
# MODIFIERS
|
||||
]
|
||||
|
||||
# MODIFIERS
|
||||
]
|
||||
|
|
|
@ -38,13 +38,16 @@ def get_varname(rpc_call):
|
|||
r = re.search(
|
||||
"([ptdf]\.|system\.|get\_|is\_|set\_)+([^=]*)", rpc_call, re.I)
|
||||
if r:
|
||||
return(r.groups()[-1])
|
||||
if rtorrent.connection.Connection._get_client_version_tuple >= .97:
|
||||
return(r.groups()[-1].replace(".","_"))
|
||||
else:
|
||||
return(r.groups()[-1])
|
||||
else:
|
||||
return(None)
|
||||
|
||||
|
||||
def _handle_unavailable_rpc_method(method, rt_obj):
|
||||
msg = "Method isn't available."
|
||||
msg = "Method " + str(method) + "isn't available."
|
||||
if rt_obj.connection._get_client_version_tuple() < method.min_version:
|
||||
msg = "This method is only available in " \
|
||||
"RTorrent version v{0} or later".format(
|
||||
|
@ -91,7 +94,7 @@ class Method:
|
|||
|
||||
def _get_method_type(self):
|
||||
"""Determine whether method is a modifier or a retriever"""
|
||||
if self.method_name[:4] == "set_": return('m') # modifier
|
||||
if self.method_name[:4] == "set_" or self.method_name[-4:] == ".set": return('m') # modifier
|
||||
else:
|
||||
return('r') # retriever
|
||||
|
||||
|
|
|
@ -138,8 +138,12 @@ class Torrent:
|
|||
|
||||
results = m.call()[0] # only sent one call, only need first result
|
||||
|
||||
offset_method_index = retriever_methods.index(
|
||||
rtorrent.rpc.find_method("f.get_offset"))
|
||||
if rtorrent.connection.Connection._get_client_version_tuple >= .97:
|
||||
offset_method_index = retriever_methods.index(
|
||||
rtorrent.rpc.find_method("f.offset"))
|
||||
else:
|
||||
offset_method_index = retriever_methods.index(
|
||||
rtorrent.rpc.find_method("f.get_offset"))
|
||||
|
||||
# make a list of the offsets of all the files, sort appropriately
|
||||
offset_list = sorted([r[offset_method_index] for r in results])
|
||||
|
@ -168,7 +172,10 @@ class Torrent:
|
|||
"""
|
||||
m = rtorrent.rpc.Multicall(self)
|
||||
self.multicall_add(m, "d.try_stop")
|
||||
self.multicall_add(m, "d.set_directory", d)
|
||||
if rtorrent.connection.Connection._get_client_version_tuple >= .97:
|
||||
self.multicall_add(m, "d.directory.set", d)
|
||||
else:
|
||||
self.multicall_add(m, "d.set_directory", d)
|
||||
|
||||
self.directory = m.call()[-1]
|
||||
|
||||
|
@ -181,7 +188,10 @@ class Torrent:
|
|||
"""
|
||||
m = rtorrent.rpc.Multicall(self)
|
||||
self.multicall_add(m, "d.try_stop")
|
||||
self.multicall_add(m, "d.set_directory_base", d)
|
||||
if rtorrent.connection.Connection._get_client_version_tuple >= .97:
|
||||
self.multicall_add(m, "d.directory_base.set", d)
|
||||
else:
|
||||
self.multicall_add(m, "d.set_directory_base", d)
|
||||
|
||||
def start(self):
|
||||
"""Start the torrent"""
|
||||
|
@ -304,7 +314,10 @@ class Torrent:
|
|||
m = rtorrent.rpc.Multicall(self)
|
||||
|
||||
field = "custom{0}".format(key)
|
||||
self.multicall_add(m, "d.get_{0}".format(field))
|
||||
if rtorrent.connection.Connection._get_client_version_tuple >= .97:
|
||||
self.multicall_add(m, "d.{0}".format(field))
|
||||
else:
|
||||
self.multicall_add(m, "d.get_{0}".format(field))
|
||||
setattr(self, field, m.call()[-1])
|
||||
|
||||
return (getattr(self, field))
|
||||
|
@ -326,7 +339,10 @@ class Torrent:
|
|||
self._assert_custom_key_valid(key)
|
||||
m = rtorrent.rpc.Multicall(self)
|
||||
|
||||
self.multicall_add(m, "d.set_custom{0}".format(key), value)
|
||||
if rtorrent.connection.Connection._get_client_version_tuple >= .97:
|
||||
self.multicall_add(m, "d.custom{0}.set".format(key), value)
|
||||
else:
|
||||
self.multicall_add(m, "d.set_custom{0}".format(key), value)
|
||||
|
||||
return(m.call()[-1])
|
||||
|
||||
|
@ -355,7 +371,10 @@ class Torrent:
|
|||
|
||||
@note: Variable where the result for this method is stored Torrent.hash_checking_queued"""
|
||||
m = rtorrent.rpc.Multicall(self)
|
||||
self.multicall_add(m, "d.get_hashing")
|
||||
if rtorrent.connection.Connection._get_client_version_tuple >= .97:
|
||||
self.multicall_add(m, "d.hashing")
|
||||
else:
|
||||
self.multicall_add(m, "d.get_hashing")
|
||||
self.multicall_add(m, "d.is_hash_checking")
|
||||
results = m.call()
|
||||
|
||||
|
@ -389,129 +408,258 @@ class Torrent:
|
|||
return(self._is_started())
|
||||
|
||||
|
||||
methods = [
|
||||
# RETRIEVERS
|
||||
Method(Torrent, 'is_hash_checked', 'd.is_hash_checked',
|
||||
boolean=True,
|
||||
),
|
||||
Method(Torrent, 'is_hash_checking', 'd.is_hash_checking',
|
||||
boolean=True,
|
||||
),
|
||||
Method(Torrent, 'get_peers_max', 'd.get_peers_max'),
|
||||
Method(Torrent, 'get_tracker_focus', 'd.get_tracker_focus'),
|
||||
Method(Torrent, 'get_skip_total', 'd.get_skip_total'),
|
||||
Method(Torrent, 'get_state', 'd.get_state'),
|
||||
Method(Torrent, 'get_peer_exchange', 'd.get_peer_exchange'),
|
||||
Method(Torrent, 'get_down_rate', 'd.get_down_rate'),
|
||||
Method(Torrent, 'get_connection_seed', 'd.get_connection_seed'),
|
||||
Method(Torrent, 'get_uploads_max', 'd.get_uploads_max'),
|
||||
Method(Torrent, 'get_priority_str', 'd.get_priority_str'),
|
||||
Method(Torrent, 'is_open', 'd.is_open',
|
||||
boolean=True,
|
||||
),
|
||||
Method(Torrent, 'get_peers_min', 'd.get_peers_min'),
|
||||
Method(Torrent, 'get_peers_complete', 'd.get_peers_complete'),
|
||||
Method(Torrent, 'get_tracker_numwant', 'd.get_tracker_numwant'),
|
||||
Method(Torrent, 'get_connection_current', 'd.get_connection_current'),
|
||||
Method(Torrent, 'is_complete', 'd.get_complete',
|
||||
boolean=True,
|
||||
),
|
||||
Method(Torrent, 'get_peers_connected', 'd.get_peers_connected'),
|
||||
Method(Torrent, 'get_chunk_size', 'd.get_chunk_size'),
|
||||
Method(Torrent, 'get_state_counter', 'd.get_state_counter'),
|
||||
Method(Torrent, 'get_base_filename', 'd.get_base_filename'),
|
||||
Method(Torrent, 'get_state_changed', 'd.get_state_changed'),
|
||||
Method(Torrent, 'get_peers_not_connected', 'd.get_peers_not_connected'),
|
||||
Method(Torrent, 'get_directory', 'd.get_directory'),
|
||||
Method(Torrent, 'is_incomplete', 'd.incomplete',
|
||||
boolean=True,
|
||||
),
|
||||
Method(Torrent, 'get_tracker_size', 'd.get_tracker_size'),
|
||||
Method(Torrent, 'is_multi_file', 'd.is_multi_file',
|
||||
boolean=True,
|
||||
),
|
||||
Method(Torrent, 'get_local_id', 'd.get_local_id'),
|
||||
Method(Torrent, 'get_ratio', 'd.get_ratio',
|
||||
post_process_func=lambda x: x / 1000.0,
|
||||
),
|
||||
Method(Torrent, 'get_loaded_file', 'd.get_loaded_file'),
|
||||
Method(Torrent, 'get_max_file_size', 'd.get_max_file_size'),
|
||||
Method(Torrent, 'get_size_chunks', 'd.get_size_chunks'),
|
||||
Method(Torrent, 'is_pex_active', 'd.is_pex_active',
|
||||
boolean=True,
|
||||
),
|
||||
Method(Torrent, 'get_hashing', 'd.get_hashing'),
|
||||
Method(Torrent, 'get_bitfield', 'd.get_bitfield'),
|
||||
Method(Torrent, 'get_local_id_html', 'd.get_local_id_html'),
|
||||
Method(Torrent, 'get_connection_leech', 'd.get_connection_leech'),
|
||||
Method(Torrent, 'get_peers_accounted', 'd.get_peers_accounted'),
|
||||
Method(Torrent, 'get_message', 'd.get_message'),
|
||||
Method(Torrent, 'is_active', 'd.is_active',
|
||||
boolean=True,
|
||||
),
|
||||
Method(Torrent, 'get_size_bytes', 'd.get_size_bytes'),
|
||||
Method(Torrent, 'get_ignore_commands', 'd.get_ignore_commands'),
|
||||
Method(Torrent, 'get_creation_date', 'd.get_creation_date'),
|
||||
Method(Torrent, 'get_base_path', 'd.get_base_path'),
|
||||
Method(Torrent, 'get_left_bytes', 'd.get_left_bytes'),
|
||||
Method(Torrent, 'get_size_files', 'd.get_size_files'),
|
||||
Method(Torrent, 'get_size_pex', 'd.get_size_pex'),
|
||||
Method(Torrent, 'is_private', 'd.is_private',
|
||||
boolean=True,
|
||||
),
|
||||
Method(Torrent, 'get_max_size_pex', 'd.get_max_size_pex'),
|
||||
Method(Torrent, 'get_num_chunks_hashed', 'd.get_chunks_hashed',
|
||||
aliases=("get_chunks_hashed",)),
|
||||
Method(Torrent, 'get_num_chunks_wanted', 'd.wanted_chunks'),
|
||||
Method(Torrent, 'get_priority', 'd.get_priority'),
|
||||
Method(Torrent, 'get_skip_rate', 'd.get_skip_rate'),
|
||||
Method(Torrent, 'get_completed_bytes', 'd.get_completed_bytes'),
|
||||
Method(Torrent, 'get_name', 'd.get_name'),
|
||||
Method(Torrent, 'get_completed_chunks', 'd.get_completed_chunks'),
|
||||
Method(Torrent, 'get_throttle_name', 'd.get_throttle_name'),
|
||||
Method(Torrent, 'get_free_diskspace', 'd.get_free_diskspace'),
|
||||
Method(Torrent, 'get_directory_base', 'd.get_directory_base'),
|
||||
Method(Torrent, 'get_hashing_failed', 'd.get_hashing_failed'),
|
||||
Method(Torrent, 'get_tied_to_file', 'd.get_tied_to_file'),
|
||||
Method(Torrent, 'get_down_total', 'd.get_down_total'),
|
||||
Method(Torrent, 'get_bytes_done', 'd.get_bytes_done'),
|
||||
Method(Torrent, 'get_up_rate', 'd.get_up_rate'),
|
||||
Method(Torrent, 'get_up_total', 'd.get_up_total'),
|
||||
Method(Torrent, 'is_accepting_seeders', 'd.accepting_seeders',
|
||||
boolean=True,
|
||||
),
|
||||
Method(Torrent, "get_chunks_seen", "d.chunks_seen",
|
||||
min_version=(0, 9, 1),
|
||||
),
|
||||
Method(Torrent, "is_partially_done", "d.is_partially_done",
|
||||
boolean=True,
|
||||
),
|
||||
Method(Torrent, "is_not_partially_done", "d.is_not_partially_done",
|
||||
boolean=True,
|
||||
),
|
||||
Method(Torrent, "get_time_started", "d.timestamp.started"),
|
||||
Method(Torrent, "get_custom1", "d.get_custom1"),
|
||||
Method(Torrent, "get_custom2", "d.get_custom2"),
|
||||
Method(Torrent, "get_custom3", "d.get_custom3"),
|
||||
Method(Torrent, "get_custom4", "d.get_custom4"),
|
||||
Method(Torrent, "get_custom5", "d.get_custom5"),
|
||||
if rtorrent.connection.Connection._get_client_version_tuple >= .97:
|
||||
methods = [
|
||||
# RETRIEVERS
|
||||
Method(Torrent, 'is_hash_checked', 'd.is_hash_checked',
|
||||
boolean=True,
|
||||
),
|
||||
Method(Torrent, 'is_hash_checking', 'd.is_hash_checking',
|
||||
boolean=True,
|
||||
),
|
||||
Method(Torrent, 'get_peers_max', 'd.peers_max'),
|
||||
Method(Torrent, 'get_tracker_focus', 'd.tracker_focus'),
|
||||
Method(Torrent, 'get_skip_total', 'd.skip_total'),
|
||||
Method(Torrent, 'get_state', 'd.state'),
|
||||
Method(Torrent, 'get_peer_exchange', 'd.peer_exchange'),
|
||||
Method(Torrent, 'get_down_rate', 'd.down_rate'),
|
||||
Method(Torrent, 'get_connection_seed', 'd.connection_seed'),
|
||||
Method(Torrent, 'get_uploads_max', 'd.uploads_max'),
|
||||
Method(Torrent, 'get_priority_str', 'd.priority_str'),
|
||||
Method(Torrent, 'is_open', 'd.is_open',
|
||||
boolean=True,
|
||||
),
|
||||
Method(Torrent, 'get_peers_min', 'd.peers_min'),
|
||||
Method(Torrent, 'get_peers_complete', 'd.peers_complete'),
|
||||
Method(Torrent, 'get_tracker_numwant', 'd.tracker_numwant'),
|
||||
Method(Torrent, 'get_connection_current', 'd.connection_current'),
|
||||
Method(Torrent, 'is_complete', 'd.complete',
|
||||
boolean=True,
|
||||
),
|
||||
Method(Torrent, 'get_peers_connected', 'd.peers_connected'),
|
||||
Method(Torrent, 'get_chunk_size', 'd.chunk_size'),
|
||||
Method(Torrent, 'get_state_counter', 'd.state_counter'),
|
||||
Method(Torrent, 'get_base_filename', 'd.base_filename'),
|
||||
Method(Torrent, 'get_state_changed', 'd.state_changed'),
|
||||
Method(Torrent, 'get_peers_not_connected', 'd.peers_not_connected'),
|
||||
Method(Torrent, 'get_directory', 'd.directory'),
|
||||
Method(Torrent, 'is_incomplete', 'd.incomplete',
|
||||
boolean=True,
|
||||
),
|
||||
Method(Torrent, 'get_tracker_size', 'd.tracker_size'),
|
||||
Method(Torrent, 'is_multi_file', 'd.is_multi_file',
|
||||
boolean=True,
|
||||
),
|
||||
Method(Torrent, 'get_local_id', 'd.local_id'),
|
||||
Method(Torrent, 'get_ratio', 'd.ratio',
|
||||
post_process_func=lambda x: x / 1000.0,
|
||||
),
|
||||
Method(Torrent, 'get_loaded_file', 'd.loaded_file'),
|
||||
Method(Torrent, 'get_max_file_size', 'd.max_file_size'),
|
||||
Method(Torrent, 'get_size_chunks', 'd.size_chunks'),
|
||||
Method(Torrent, 'is_pex_active', 'd.is_pex_active',
|
||||
boolean=True,
|
||||
),
|
||||
Method(Torrent, 'get_hashing', 'd.hashing'),
|
||||
Method(Torrent, 'get_bitfield', 'd.bitfield'),
|
||||
Method(Torrent, 'get_local_id_html', 'd.local_id_html'),
|
||||
Method(Torrent, 'get_connection_leech', 'd.connection_leech'),
|
||||
Method(Torrent, 'get_peers_accounted', 'd.peers_accounted'),
|
||||
Method(Torrent, 'get_message', 'd.message'),
|
||||
Method(Torrent, 'is_active', 'd.is_active',
|
||||
boolean=True,
|
||||
),
|
||||
Method(Torrent, 'get_size_bytes', 'd.size_bytes'),
|
||||
Method(Torrent, 'get_ignore_commands', 'd.ignore_commands'),
|
||||
Method(Torrent, 'get_creation_date', 'd.creation_date'),
|
||||
Method(Torrent, 'get_base_path', 'd.base_path'),
|
||||
Method(Torrent, 'get_left_bytes', 'd.left_bytes'),
|
||||
Method(Torrent, 'get_size_files', 'd.size_files'),
|
||||
Method(Torrent, 'get_size_pex', 'd.size_pex'),
|
||||
Method(Torrent, 'is_private', 'd.is_private',
|
||||
boolean=True,
|
||||
),
|
||||
Method(Torrent, 'get_max_size_pex', 'd.max_size_pex'),
|
||||
Method(Torrent, 'get_num_chunks_hashed', 'd.chunks_hashed',
|
||||
aliases=("get_chunks_hashed",)),
|
||||
Method(Torrent, 'get_num_chunks_wanted', 'd.wanted_chunks'),
|
||||
Method(Torrent, 'get_priority', 'd.priority'),
|
||||
Method(Torrent, 'get_skip_rate', 'd.skip.rate'),
|
||||
Method(Torrent, 'get_completed_bytes', 'd.completed_bytes'),
|
||||
Method(Torrent, 'get_name', 'd.name'),
|
||||
Method(Torrent, 'get_completed_chunks', 'd.completed_chunks'),
|
||||
Method(Torrent, 'get_throttle_name', 'd.throttle_name'),
|
||||
Method(Torrent, 'get_free_diskspace', 'd.free_diskspace'),
|
||||
Method(Torrent, 'get_directory_base', 'd.directory_base'),
|
||||
Method(Torrent, 'get_hashing_failed', 'd.hashing_failed'),
|
||||
Method(Torrent, 'get_tied_to_file', 'd.tied_to_file'),
|
||||
Method(Torrent, 'get_down_total', 'd.down.total'),
|
||||
Method(Torrent, 'get_bytes_done', 'd.bytes_done'),
|
||||
Method(Torrent, 'get_up_rate', 'd.up.rate'),
|
||||
Method(Torrent, 'get_up_total', 'd.up.total'),
|
||||
Method(Torrent, 'is_accepting_seeders', 'd.accepting_seeders',
|
||||
boolean=True,
|
||||
),
|
||||
Method(Torrent, "get_chunks_seen", "d.chunks_seen",
|
||||
min_version=(0, 9, 1),
|
||||
),
|
||||
Method(Torrent, "is_partially_done", "d.is_partially_done",
|
||||
boolean=True,
|
||||
),
|
||||
Method(Torrent, "is_not_partially_done", "d.is_not_partially_done",
|
||||
boolean=True,
|
||||
),
|
||||
Method(Torrent, "get_time_started", "d.timestamp.started"),
|
||||
Method(Torrent, "get_custom1", "d.custom1"),
|
||||
Method(Torrent, "get_custom2", "d.custom2"),
|
||||
Method(Torrent, "get_custom3", "d.custom3"),
|
||||
Method(Torrent, "get_custom4", "d.custom4"),
|
||||
Method(Torrent, "get_custom5", "d.custom5"),
|
||||
|
||||
# MODIFIERS
|
||||
Method(Torrent, 'set_uploads_max', 'd.set_uploads_max'),
|
||||
Method(Torrent, 'set_tied_to_file', 'd.set_tied_to_file'),
|
||||
Method(Torrent, 'set_tracker_numwant', 'd.set_tracker_numwant'),
|
||||
Method(Torrent, 'set_priority', 'd.set_priority'),
|
||||
Method(Torrent, 'set_peers_max', 'd.set_peers_max'),
|
||||
Method(Torrent, 'set_hashing_failed', 'd.set_hashing_failed'),
|
||||
Method(Torrent, 'set_message', 'd.set_message'),
|
||||
Method(Torrent, 'set_throttle_name', 'd.set_throttle_name'),
|
||||
Method(Torrent, 'set_peers_min', 'd.set_peers_min'),
|
||||
Method(Torrent, 'set_ignore_commands', 'd.set_ignore_commands'),
|
||||
Method(Torrent, 'set_max_file_size', 'd.set_max_file_size'),
|
||||
Method(Torrent, 'set_custom5', 'd.set_custom5'),
|
||||
Method(Torrent, 'set_custom4', 'd.set_custom4'),
|
||||
Method(Torrent, 'set_custom2', 'd.set_custom2'),
|
||||
Method(Torrent, 'set_custom1', 'd.set_custom1'),
|
||||
Method(Torrent, 'set_custom3', 'd.set_custom3'),
|
||||
Method(Torrent, 'set_connection_current', 'd.set_connection_current'),
|
||||
]
|
||||
# MODIFIERS
|
||||
Method(Torrent, 'set_uploads_max', 'd.uploads_max.set'),
|
||||
Method(Torrent, 'set_tied_to_file', 'd.tied_to_file.set'),
|
||||
Method(Torrent, 'set_tracker_numwant', 'd.tracker_numwant.set'),
|
||||
Method(Torrent, 'set_priority', 'd.priority.set'),
|
||||
Method(Torrent, 'set_peers_max', 'd.peers_max.set'),
|
||||
Method(Torrent, 'set_hashing_failed', 'd.hashing_failed.set'),
|
||||
Method(Torrent, 'set_message', 'd.message.set'),
|
||||
Method(Torrent, 'set_throttle_name', 'd.throttle_name.set'),
|
||||
Method(Torrent, 'set_peers_min', 'd.peers_min.set'),
|
||||
Method(Torrent, 'set_ignore_commands', 'd.ignore_commands.set'),
|
||||
Method(Torrent, 'set_max_file_size', 'd.max_file_size.set'),
|
||||
Method(Torrent, 'set_custom5', 'd.custom5.set'),
|
||||
Method(Torrent, 'set_custom4', 'd.custom4.set'),
|
||||
Method(Torrent, 'set_custom2', 'd.custom2.set'),
|
||||
Method(Torrent, 'set_custom1', 'd.custom1.set'),
|
||||
Method(Torrent, 'set_custom3', 'd.custom3.set'),
|
||||
Method(Torrent, 'set_connection_current', 'd.connection_current.set'),
|
||||
]
|
||||
|
||||
else:
|
||||
methods = [
|
||||
# RETRIEVERS
|
||||
Method(Torrent, 'is_hash_checked', 'd.is_hash_checked',
|
||||
boolean=True,
|
||||
),
|
||||
Method(Torrent, 'is_hash_checking', 'd.is_hash_checking',
|
||||
boolean=True,
|
||||
),
|
||||
Method(Torrent, 'get_peers_max', 'd.get_peers_max'),
|
||||
Method(Torrent, 'get_tracker_focus', 'd.get_tracker_focus'),
|
||||
Method(Torrent, 'get_skip_total', 'd.get_skip_total'),
|
||||
Method(Torrent, 'get_state', 'd.get_state'),
|
||||
Method(Torrent, 'get_peer_exchange', 'd.get_peer_exchange'),
|
||||
Method(Torrent, 'get_down_rate', 'd.get_down_rate'),
|
||||
Method(Torrent, 'get_connection_seed', 'd.get_connection_seed'),
|
||||
Method(Torrent, 'get_uploads_max', 'd.get_uploads_max'),
|
||||
Method(Torrent, 'get_priority_str', 'd.get_priority_str'),
|
||||
Method(Torrent, 'is_open', 'd.is_open',
|
||||
boolean=True,
|
||||
),
|
||||
Method(Torrent, 'get_peers_min', 'd.get_peers_min'),
|
||||
Method(Torrent, 'get_peers_complete', 'd.get_peers_complete'),
|
||||
Method(Torrent, 'get_tracker_numwant', 'd.get_tracker_numwant'),
|
||||
Method(Torrent, 'get_connection_current', 'd.get_connection_current'),
|
||||
Method(Torrent, 'is_complete', 'd.get_complete',
|
||||
boolean=True,
|
||||
),
|
||||
Method(Torrent, 'get_peers_connected', 'd.get_peers_connected'),
|
||||
Method(Torrent, 'get_chunk_size', 'd.get_chunk_size'),
|
||||
Method(Torrent, 'get_state_counter', 'd.get_state_counter'),
|
||||
Method(Torrent, 'get_base_filename', 'd.get_base_filename'),
|
||||
Method(Torrent, 'get_state_changed', 'd.get_state_changed'),
|
||||
Method(Torrent, 'get_peers_not_connected', 'd.get_peers_not_connected'),
|
||||
Method(Torrent, 'get_directory', 'd.get_directory'),
|
||||
Method(Torrent, 'is_incomplete', 'd.incomplete',
|
||||
boolean=True,
|
||||
),
|
||||
Method(Torrent, 'get_tracker_size', 'd.get_tracker_size'),
|
||||
Method(Torrent, 'is_multi_file', 'd.is_multi_file',
|
||||
boolean=True,
|
||||
),
|
||||
Method(Torrent, 'get_local_id', 'd.get_local_id'),
|
||||
Method(Torrent, 'get_ratio', 'd.get_ratio',
|
||||
post_process_func=lambda x: x / 1000.0,
|
||||
),
|
||||
Method(Torrent, 'get_loaded_file', 'd.get_loaded_file'),
|
||||
Method(Torrent, 'get_max_file_size', 'd.get_max_file_size'),
|
||||
Method(Torrent, 'get_size_chunks', 'd.get_size_chunks'),
|
||||
Method(Torrent, 'is_pex_active', 'd.is_pex_active',
|
||||
boolean=True,
|
||||
),
|
||||
Method(Torrent, 'get_hashing', 'd.get_hashing'),
|
||||
Method(Torrent, 'get_bitfield', 'd.get_bitfield'),
|
||||
Method(Torrent, 'get_local_id_html', 'd.get_local_id_html'),
|
||||
Method(Torrent, 'get_connection_leech', 'd.get_connection_leech'),
|
||||
Method(Torrent, 'get_peers_accounted', 'd.get_peers_accounted'),
|
||||
Method(Torrent, 'get_message', 'd.get_message'),
|
||||
Method(Torrent, 'is_active', 'd.is_active',
|
||||
boolean=True,
|
||||
),
|
||||
Method(Torrent, 'get_size_bytes', 'd.get_size_bytes'),
|
||||
Method(Torrent, 'get_ignore_commands', 'd.get_ignore_commands'),
|
||||
Method(Torrent, 'get_creation_date', 'd.get_creation_date'),
|
||||
Method(Torrent, 'get_base_path', 'd.get_base_path'),
|
||||
Method(Torrent, 'get_left_bytes', 'd.get_left_bytes'),
|
||||
Method(Torrent, 'get_size_files', 'd.get_size_files'),
|
||||
Method(Torrent, 'get_size_pex', 'd.get_size_pex'),
|
||||
Method(Torrent, 'is_private', 'd.is_private',
|
||||
boolean=True,
|
||||
),
|
||||
Method(Torrent, 'get_max_size_pex', 'd.get_max_size_pex'),
|
||||
Method(Torrent, 'get_num_chunks_hashed', 'd.get_chunks_hashed',
|
||||
aliases=("get_chunks_hashed",)),
|
||||
Method(Torrent, 'get_num_chunks_wanted', 'd.wanted_chunks'),
|
||||
Method(Torrent, 'get_priority', 'd.get_priority'),
|
||||
Method(Torrent, 'get_skip_rate', 'd.get_skip_rate'),
|
||||
Method(Torrent, 'get_completed_bytes', 'd.get_completed_bytes'),
|
||||
Method(Torrent, 'get_name', 'd.get_name'),
|
||||
Method(Torrent, 'get_completed_chunks', 'd.get_completed_chunks'),
|
||||
Method(Torrent, 'get_throttle_name', 'd.get_throttle_name'),
|
||||
Method(Torrent, 'get_free_diskspace', 'd.get_free_diskspace'),
|
||||
Method(Torrent, 'get_directory_base', 'd.get_directory_base'),
|
||||
Method(Torrent, 'get_hashing_failed', 'd.get_hashing_failed'),
|
||||
Method(Torrent, 'get_tied_to_file', 'd.get_tied_to_file'),
|
||||
Method(Torrent, 'get_down_total', 'd.get_down_total'),
|
||||
Method(Torrent, 'get_bytes_done', 'd.get_bytes_done'),
|
||||
Method(Torrent, 'get_up_rate', 'd.get_up_rate'),
|
||||
Method(Torrent, 'get_up_total', 'd.get_up_total'),
|
||||
Method(Torrent, 'is_accepting_seeders', 'd.accepting_seeders',
|
||||
boolean=True,
|
||||
),
|
||||
Method(Torrent, "get_chunks_seen", "d.chunks_seen",
|
||||
min_version=(0, 9, 1),
|
||||
),
|
||||
Method(Torrent, "is_partially_done", "d.is_partially_done",
|
||||
boolean=True,
|
||||
),
|
||||
Method(Torrent, "is_not_partially_done", "d.is_not_partially_done",
|
||||
boolean=True,
|
||||
),
|
||||
Method(Torrent, "get_time_started", "d.timestamp.started"),
|
||||
Method(Torrent, "get_custom1", "d.get_custom1"),
|
||||
Method(Torrent, "get_custom2", "d.get_custom2"),
|
||||
Method(Torrent, "get_custom3", "d.get_custom3"),
|
||||
Method(Torrent, "get_custom4", "d.get_custom4"),
|
||||
Method(Torrent, "get_custom5", "d.get_custom5"),
|
||||
|
||||
# MODIFIERS
|
||||
Method(Torrent, 'set_uploads_max', 'd.set_uploads_max'),
|
||||
Method(Torrent, 'set_tied_to_file', 'd.set_tied_to_file'),
|
||||
Method(Torrent, 'set_tracker_numwant', 'd.set_tracker_numwant'),
|
||||
Method(Torrent, 'set_priority', 'd.set_priority'),
|
||||
Method(Torrent, 'set_peers_max', 'd.set_peers_max'),
|
||||
Method(Torrent, 'set_hashing_failed', 'd.set_hashing_failed'),
|
||||
Method(Torrent, 'set_message', 'd.set_message'),
|
||||
Method(Torrent, 'set_throttle_name', 'd.set_throttle_name'),
|
||||
Method(Torrent, 'set_peers_min', 'd.set_peers_min'),
|
||||
Method(Torrent, 'set_ignore_commands', 'd.set_ignore_commands'),
|
||||
Method(Torrent, 'set_max_file_size', 'd.set_max_file_size'),
|
||||
Method(Torrent, 'set_custom5', 'd.set_custom5'),
|
||||
Method(Torrent, 'set_custom4', 'd.set_custom4'),
|
||||
Method(Torrent, 'set_custom2', 'd.set_custom2'),
|
||||
Method(Torrent, 'set_custom1', 'd.set_custom1'),
|
||||
Method(Torrent, 'set_custom3', 'd.set_custom3'),
|
||||
Method(Torrent, 'set_connection_current', 'd.set_connection_current'),
|
||||
]
|
||||
|
|
|
@ -67,72 +67,144 @@ class Tracker:
|
|||
|
||||
multicall.call()
|
||||
|
||||
methods = [
|
||||
# RETRIEVERS
|
||||
Method(Tracker, 'is_enabled', 't.is_enabled', boolean=True),
|
||||
Method(Tracker, 'get_id', 't.get_id'),
|
||||
Method(Tracker, 'get_scrape_incomplete', 't.get_scrape_incomplete'),
|
||||
Method(Tracker, 'is_open', 't.is_open', boolean=True),
|
||||
Method(Tracker, 'get_min_interval', 't.get_min_interval'),
|
||||
Method(Tracker, 'get_scrape_downloaded', 't.get_scrape_downloaded'),
|
||||
Method(Tracker, 'get_group', 't.get_group'),
|
||||
Method(Tracker, 'get_scrape_time_last', 't.get_scrape_time_last'),
|
||||
Method(Tracker, 'get_type', 't.get_type'),
|
||||
Method(Tracker, 'get_normal_interval', 't.get_normal_interval'),
|
||||
Method(Tracker, 'get_url', 't.get_url'),
|
||||
Method(Tracker, 'get_scrape_complete', 't.get_scrape_complete',
|
||||
min_version=(0, 8, 9),
|
||||
),
|
||||
Method(Tracker, 'get_activity_time_last', 't.activity_time_last',
|
||||
min_version=(0, 8, 9),
|
||||
),
|
||||
Method(Tracker, 'get_activity_time_next', 't.activity_time_next',
|
||||
min_version=(0, 8, 9),
|
||||
),
|
||||
Method(Tracker, 'get_failed_time_last', 't.failed_time_last',
|
||||
min_version=(0, 8, 9),
|
||||
),
|
||||
Method(Tracker, 'get_failed_time_next', 't.failed_time_next',
|
||||
min_version=(0, 8, 9),
|
||||
),
|
||||
Method(Tracker, 'get_success_time_last', 't.success_time_last',
|
||||
min_version=(0, 8, 9),
|
||||
),
|
||||
Method(Tracker, 'get_success_time_next', 't.success_time_next',
|
||||
min_version=(0, 8, 9),
|
||||
),
|
||||
Method(Tracker, 'can_scrape', 't.can_scrape',
|
||||
min_version=(0, 9, 1),
|
||||
boolean=True
|
||||
),
|
||||
Method(Tracker, 'get_failed_counter', 't.failed_counter',
|
||||
min_version=(0, 8, 9)
|
||||
),
|
||||
Method(Tracker, 'get_scrape_counter', 't.scrape_counter',
|
||||
min_version=(0, 8, 9)
|
||||
),
|
||||
Method(Tracker, 'get_success_counter', 't.success_counter',
|
||||
min_version=(0, 8, 9)
|
||||
),
|
||||
Method(Tracker, 'is_usable', 't.is_usable',
|
||||
min_version=(0, 9, 1),
|
||||
boolean=True
|
||||
),
|
||||
Method(Tracker, 'is_busy', 't.is_busy',
|
||||
min_version=(0, 9, 1),
|
||||
boolean=True
|
||||
),
|
||||
Method(Tracker, 'is_extra_tracker', 't.is_extra_tracker',
|
||||
min_version=(0, 9, 1),
|
||||
boolean=True,
|
||||
),
|
||||
Method(Tracker, "get_latest_sum_peers", "t.latest_sum_peers",
|
||||
min_version=(0, 9, 0)
|
||||
),
|
||||
Method(Tracker, "get_latest_new_peers", "t.latest_new_peers",
|
||||
min_version=(0, 9, 0)
|
||||
),
|
||||
if rtorrent.connection.Connection._get_client_version_tuple >= .97:
|
||||
methods = [
|
||||
# RETRIEVERS
|
||||
Method(Tracker, 'is_enabled', 't.is_enabled', boolean=True),
|
||||
Method(Tracker, 'get_id', 't.id'),
|
||||
Method(Tracker, 'get_scrape_incomplete', 't.scrape_incomplete'),
|
||||
Method(Tracker, 'is_open', 't.is_open', boolean=True),
|
||||
Method(Tracker, 'get_min_interval', 't.min_interval'),
|
||||
Method(Tracker, 'get_scrape_downloaded', 't.scrape_downloaded'),
|
||||
Method(Tracker, 'get_group', 't.group'),
|
||||
Method(Tracker, 'get_scrape_time_last', 't.scrape_time_last'),
|
||||
Method(Tracker, 'get_type', 't.type'),
|
||||
Method(Tracker, 'get_normal_interval', 't.normal_interval'),
|
||||
Method(Tracker, 'get_url', 't.url'),
|
||||
Method(Tracker, 'get_scrape_complete', 't.scrape_complete',
|
||||
min_version=(0, 8, 9),
|
||||
),
|
||||
Method(Tracker, 'get_activity_time_last', 't.activity_time_last',
|
||||
min_version=(0, 8, 9),
|
||||
),
|
||||
Method(Tracker, 'get_activity_time_next', 't.activity_time_next',
|
||||
min_version=(0, 8, 9),
|
||||
),
|
||||
Method(Tracker, 'get_failed_time_last', 't.failed_time_last',
|
||||
min_version=(0, 8, 9),
|
||||
),
|
||||
Method(Tracker, 'get_failed_time_next', 't.failed_time_next',
|
||||
min_version=(0, 8, 9),
|
||||
),
|
||||
Method(Tracker, 'get_success_time_last', 't.success_time_last',
|
||||
min_version=(0, 8, 9),
|
||||
),
|
||||
Method(Tracker, 'get_success_time_next', 't.success_time_next',
|
||||
min_version=(0, 8, 9),
|
||||
),
|
||||
Method(Tracker, 'can_scrape', 't.can_scrape',
|
||||
min_version=(0, 9, 1),
|
||||
boolean=True
|
||||
),
|
||||
Method(Tracker, 'get_failed_counter', 't.failed_counter',
|
||||
min_version=(0, 8, 9)
|
||||
),
|
||||
Method(Tracker, 'get_scrape_counter', 't.scrape_counter',
|
||||
min_version=(0, 8, 9)
|
||||
),
|
||||
Method(Tracker, 'get_success_counter', 't.success_counter',
|
||||
min_version=(0, 8, 9)
|
||||
),
|
||||
Method(Tracker, 'is_usable', 't.is_usable',
|
||||
min_version=(0, 9, 1),
|
||||
boolean=True
|
||||
),
|
||||
Method(Tracker, 'is_busy', 't.is_busy',
|
||||
min_version=(0, 9, 1),
|
||||
boolean=True
|
||||
),
|
||||
Method(Tracker, 'is_extra_tracker', 't.is_extra_tracker',
|
||||
min_version=(0, 9, 1),
|
||||
boolean=True,
|
||||
),
|
||||
Method(Tracker, "get_latest_sum_peers", "t.latest_sum_peers",
|
||||
min_version=(0, 9, 0)
|
||||
),
|
||||
Method(Tracker, "get_latest_new_peers", "t.latest_new_peers",
|
||||
min_version=(0, 9, 0)
|
||||
),
|
||||
|
||||
# MODIFIERS
|
||||
Method(Tracker, 'set_enabled', 't.set_enabled'),
|
||||
]
|
||||
# MODIFIERS
|
||||
Method(Tracker, 'set_enabled', 't.is_enabled.set'),
|
||||
]
|
||||
|
||||
else:
|
||||
methods = [
|
||||
# RETRIEVERS
|
||||
Method(Tracker, 'is_enabled', 't.is_enabled', boolean=True),
|
||||
Method(Tracker, 'get_id', 't.get_id'),
|
||||
Method(Tracker, 'get_scrape_incomplete', 't.get_scrape_incomplete'),
|
||||
Method(Tracker, 'is_open', 't.is_open', boolean=True),
|
||||
Method(Tracker, 'get_min_interval', 't.get_min_interval'),
|
||||
Method(Tracker, 'get_scrape_downloaded', 't.get_scrape_downloaded'),
|
||||
Method(Tracker, 'get_group', 't.get_group'),
|
||||
Method(Tracker, 'get_scrape_time_last', 't.get_scrape_time_last'),
|
||||
Method(Tracker, 'get_type', 't.get_type'),
|
||||
Method(Tracker, 'get_normal_interval', 't.get_normal_interval'),
|
||||
Method(Tracker, 'get_url', 't.get_url'),
|
||||
Method(Tracker, 'get_scrape_complete', 't.get_scrape_complete',
|
||||
min_version=(0, 8, 9),
|
||||
),
|
||||
Method(Tracker, 'get_activity_time_last', 't.activity_time_last',
|
||||
min_version=(0, 8, 9),
|
||||
),
|
||||
Method(Tracker, 'get_activity_time_next', 't.activity_time_next',
|
||||
min_version=(0, 8, 9),
|
||||
),
|
||||
Method(Tracker, 'get_failed_time_last', 't.failed_time_last',
|
||||
min_version=(0, 8, 9),
|
||||
),
|
||||
Method(Tracker, 'get_failed_time_next', 't.failed_time_next',
|
||||
min_version=(0, 8, 9),
|
||||
),
|
||||
Method(Tracker, 'get_success_time_last', 't.success_time_last',
|
||||
min_version=(0, 8, 9),
|
||||
),
|
||||
Method(Tracker, 'get_success_time_next', 't.success_time_next',
|
||||
min_version=(0, 8, 9),
|
||||
),
|
||||
Method(Tracker, 'can_scrape', 't.can_scrape',
|
||||
min_version=(0, 9, 1),
|
||||
boolean=True
|
||||
),
|
||||
Method(Tracker, 'get_failed_counter', 't.failed_counter',
|
||||
min_version=(0, 8, 9)
|
||||
),
|
||||
Method(Tracker, 'get_scrape_counter', 't.scrape_counter',
|
||||
min_version=(0, 8, 9)
|
||||
),
|
||||
Method(Tracker, 'get_success_counter', 't.success_counter',
|
||||
min_version=(0, 8, 9)
|
||||
),
|
||||
Method(Tracker, 'is_usable', 't.is_usable',
|
||||
min_version=(0, 9, 1),
|
||||
boolean=True
|
||||
),
|
||||
Method(Tracker, 'is_busy', 't.is_busy',
|
||||
min_version=(0, 9, 1),
|
||||
boolean=True
|
||||
),
|
||||
Method(Tracker, 'is_extra_tracker', 't.is_extra_tracker',
|
||||
min_version=(0, 9, 1),
|
||||
boolean=True,
|
||||
),
|
||||
Method(Tracker, "get_latest_sum_peers", "t.latest_sum_peers",
|
||||
min_version=(0, 9, 0)
|
||||
),
|
||||
Method(Tracker, "get_latest_new_peers", "t.latest_new_peers",
|
||||
min_version=(0, 9, 0)
|
||||
),
|
||||
|
||||
# MODIFIERS
|
||||
Method(Tracker, 'set_enabled', 't.set_enabled'),
|
||||
]
|
||||
|
|
|
@ -710,6 +710,8 @@ class PostProcessor(object):
|
|||
|
||||
if re.sub('\|', '', xseries) == re.sub('\|', '', xfile):
|
||||
logger.fdebug('%s[DEFINITIVE-NAME MATCH] Definitive name match exactly to : %s [%s]' % (module, watchmatch['series_name'], cs['ComicID']))
|
||||
if len(manual_list) > 1:
|
||||
manual_list = [item for item in manual_list if all([item['IssueID'] == isc['IssueID'], item['AnnualType'] is not None]) or all([item['IssueID'] == isc['IssueID'], item['ComicLocation'] == clocation]) or all([item['IssueID'] != isc['IssueID'], item['ComicLocation'] != clocation])]
|
||||
self.matched = True
|
||||
else:
|
||||
continue #break
|
||||
|
|
|
@ -158,6 +158,7 @@ class AuthController(object):
|
|||
sess = cherrypy.session
|
||||
username = sess.get(SESSION_KEY, None)
|
||||
sess[SESSION_KEY] = None
|
||||
return self.get_loginform("", from_page=from_page)
|
||||
if username:
|
||||
cherrypy.request.login = None
|
||||
self.on_logout(username)
|
||||
|
|
|
@ -52,6 +52,7 @@ _CONFIG_DEFINITIONS = OrderedDict({
|
|||
'ZERO_LEVEL_N': (str, 'General', None),
|
||||
'LOWERCASE_FILENAMES': (bool, 'General', False),
|
||||
'IGNORE_HAVETOTAL': (bool, 'General', False),
|
||||
'IGNORE_TOTAL': (bool, 'General', False),
|
||||
'SNATCHED_HAVETOTAL': (bool, 'General', False),
|
||||
'FAILED_DOWNLOAD_HANDLING': (bool, 'General', False),
|
||||
'FAILED_AUTO': (bool, 'General',False),
|
||||
|
@ -72,6 +73,7 @@ _CONFIG_DEFINITIONS = OrderedDict({
|
|||
'CREATE_FOLDERS': (bool, 'General', True),
|
||||
'ALTERNATE_LATEST_SERIES_COVERS': (bool, 'General', False),
|
||||
'SHOW_ICONS': (bool, 'General', False),
|
||||
'FORMAT_BOOKTYPE': (bool, 'General', False),
|
||||
|
||||
'RSS_CHECKINTERVAL': (int, 'Scheduler', 20),
|
||||
'SEARCH_INTERVAL': (int, 'Scheduler', 360),
|
||||
|
@ -808,6 +810,11 @@ class Config(object):
|
|||
elif all([self.HTTP_USERNAME is None, self.HTTP_PASSWORD is None]):
|
||||
self.AUTHENTICATION = 0
|
||||
|
||||
if all([self.IGNORE_TOTAL is True, self.IGNORE_HAVETOTAL is True]):
|
||||
self.IGNORE_TOTAL = False
|
||||
self.IGNORE_HAVETOTAL = False
|
||||
logger.warn('You cannot have both ignore_total and ignore_havetotal enabled in the config.ini at the same time. Set only ONE to true - disabling both until this is resolved.')
|
||||
|
||||
#comictagger - force to use included version if option is enabled.
|
||||
if self.ENABLE_META:
|
||||
mylar.CMTAGGER_PATH = mylar.PROG_DIR
|
||||
|
|
|
@ -1061,7 +1061,7 @@ class FileChecker(object):
|
|||
|
||||
else:
|
||||
loopchk = []
|
||||
logger.info('loopchk: ' + str(loopchk))
|
||||
#logger.info('loopchk: ' + str(loopchk))
|
||||
|
||||
#if the names match up, and enable annuals isn't turned on - keep it all together.
|
||||
if re.sub('\|', '', nspace_watchcomic.lower()).strip() == re.sub('\|', '', nspace_seriesname.lower()).strip() and enable_annual == False:
|
||||
|
@ -1207,7 +1207,8 @@ class FileChecker(object):
|
|||
#logger.fdebug('watch dynamic handlers recognized : ' + str(watchdynamic_handlers_match))
|
||||
watchdynamic_replacements_match = [x for x in self.dynamic_replacements if x.lower() in self.watchcomic.lower()]
|
||||
#logger.fdebug('watch dynamic replacements recognized : ' + str(watchdynamic_replacements_match))
|
||||
mod_watchcomic = re.sub('[\s\_\.\s+\#]', '', self.watchcomic)
|
||||
mod_watchcomic = re.sub('[\s\s+\_\.]', '%$', self.watchcomic)
|
||||
mod_watchcomic = re.sub('[\#]', '', mod_watchcomic)
|
||||
mod_find = []
|
||||
wdrm_find = []
|
||||
if any([watchdynamic_handlers_match, watchdynamic_replacements_match]):
|
||||
|
@ -1220,7 +1221,7 @@ class FileChecker(object):
|
|||
spacer = ''
|
||||
for i in range(0, len(wdhm)):
|
||||
spacer+='|'
|
||||
mod_watchcomic = mod_watchcomic[:mf] + spacer + mod_watchcomic[mf+len(wdhm):]
|
||||
mod_watchcomic = mod_watchcomic[:mf] + spacer + mod_watchcomic[mf+1:]
|
||||
|
||||
for wdrm in watchdynamic_replacements_match:
|
||||
wdrm_find.extend([m.start() for m in re.finditer(wdrm.lower(), mod_watchcomic.lower())])
|
||||
|
|
|
@ -1486,9 +1486,10 @@ def forceRescan(ComicID, archive=None, module=None, recheck=False):
|
|||
|
||||
ignorecount = 0
|
||||
if mylar.CONFIG.IGNORE_HAVETOTAL: # if this is enabled, will increase Have total as if in Archived Status
|
||||
ignores = myDB.select("SELECT count(*) FROM issues WHERE ComicID=? AND Status='Ignored'", [ComicID])
|
||||
if int(ignores[0][0]) > 0:
|
||||
ignorecount = ignores[0][0]
|
||||
ignoresi = myDB.select("SELECT count(*) FROM issues WHERE ComicID=? AND Status='Ignored'", [ComicID])
|
||||
ignoresa = myDB.select("SELECT count(*) FROM annuals WHERE ComicID=? AND Status='Ignored'", [ComicID])
|
||||
ignorecount = int(ignoresi[0][0]) + int(ignoresa[0][0])
|
||||
if ignorecount > 0:
|
||||
havefiles = havefiles + ignorecount
|
||||
logger.fdebug(module + ' Adjusting have total to ' + str(havefiles) + ' because of this many Ignored files:' + str(ignorecount))
|
||||
|
||||
|
@ -1545,7 +1546,15 @@ def forceRescan(ComicID, archive=None, module=None, recheck=False):
|
|||
havefiles = havefiles + archivedissues #arcfiles already tallied in havefiles in above segment
|
||||
|
||||
#combined total for dispay total purposes only.
|
||||
combined_total = iscnt + anncnt #(rescan['Total'] + anncnt)
|
||||
combined_total = iscnt + anncnt
|
||||
if mylar.CONFIG.IGNORE_TOTAL: # if this is enabled, will increase Have total as if in Archived Status
|
||||
ignoresa = myDB.select("SELECT count(*) FROM issues WHERE ComicID=? AND Status='Ignored'", [ComicID])
|
||||
ignoresb = myDB.select("SELECT count(*) FROM annuals WHERE ComicID=? AND Status='Ignored'", [ComicID])
|
||||
ignorecnt = ignoresa[0][0] + ignoresb[0][0]
|
||||
|
||||
if ignorecnt > 0:
|
||||
combined_total -= ignorecnt
|
||||
logger.fdebug('%s Reducing total comics in series from %s to %s because of %s ignored files.' % (module, (iscnt+anncnt), combined_total, ignorecnt))
|
||||
|
||||
#quick check
|
||||
if havefiles > combined_total:
|
||||
|
|
|
@ -4935,7 +4935,7 @@ class WebInterface(object):
|
|||
'lowercase_filenames', 'autowant_upcoming', 'autowant_all', 'comic_cover_local', 'alternate_latest_series_covers', 'cvinfo', 'snatchedtorrent_notify',
|
||||
'prowl_enabled', 'prowl_onsnatch', 'nma_enabled', 'nma_onsnatch', 'pushover_enabled', 'pushover_onsnatch', 'boxcar_enabled',
|
||||
'boxcar_onsnatch', 'pushbullet_enabled', 'pushbullet_onsnatch', 'telegram_enabled', 'telegram_onsnatch', 'slack_enabled', 'slack_onsnatch',
|
||||
'opds_enable', 'opds_authentication', 'opds_metainfo', 'alphaindex']
|
||||
'opds_enable', 'opds_authentication', 'opds_metainfo']
|
||||
|
||||
for checked_config in checked_configs:
|
||||
if checked_config not in kwargs:
|
||||
|
|
|
@ -159,11 +159,12 @@ def initialize(options):
|
|||
user_list[options['opds_username']] = options['opds_password']
|
||||
if options['http_password'] is not None and options['http_username'] != options['opds_username']:
|
||||
user_list[options['http_username']] = options['http_password']
|
||||
conf['/opds'] = {'tools.auth_basic.on': True,
|
||||
conf['/opds'] = {'tools.auth.on': False,
|
||||
'tools.auth_basic.on': True,
|
||||
'tools.auth_basic.realm': 'Mylar OPDS',
|
||||
'tools.auth_basic.checkpassword': cherrypy.lib.auth_basic.checkpassword_dict(user_list)}
|
||||
else:
|
||||
conf['/opds'] = {'tools.auth_basic.on': False}
|
||||
conf['/opds'] = {'tools.auth_basic.on': False, 'tools.auth.on': False}
|
||||
|
||||
# Prevent time-outs
|
||||
cherrypy.engine.timeout_monitor.unsubscribe()
|
||||
|
|
Loading…
Reference in New Issue