show some counts in ui

This commit is contained in:
dave 2019-08-17 23:34:26 -07:00
parent c067278f03
commit 508448229b
3 changed files with 10 additions and 5 deletions

View File

@ -202,7 +202,7 @@ class MediaWeb(object):
pmap = client.pathmap
fname = get_fname(torrent)
in_library_path = os.path.join(match.dest.dir, match.subdest, fname) # path relative from the library's root
in_library_path = os.path.join(match.dest.dir, match.subdest, fname) # path relative from the library's root
client_full_path = os.path.join(torrent["save_path"], fname) # absolute storage path in deluge
assert client_full_path[0:len(pmap[0])] == pmap[0] # sanity check: deluge's path must starts with our pathmap
@ -234,7 +234,7 @@ class MediaWeb(object):
torrent = client.rpc.core.get_torrent_status(thash, []) # TODO reduce to needed fields
self.execute_move(tkey, torrent, self.cache.moves[tkey])
self.rpc.refresh()
self.cache.refresh()
# TODO summary display of results
return f"autosorted: {repr(tkeys)}"
@ -314,7 +314,8 @@ def main():
tpl_dir = os.path.join(APPROOT, "templates")
tpl = Environment(loader=FileSystemLoader(tpl_dir),
autoescape=select_autoescape(['html', 'xml']))
tpl.filters.update(tsortbyname=tsortbyname)
tpl.filters.update(tsortbyname=tsortbyname,
len=len, )
def validate_password(realm, user, passw):
return user == passw # lol

View File

@ -21,7 +21,7 @@
</tr>
{% for torid, tor in torrents.items()|tsortbyname %}{% if tor.is_finished %}
<tr>
<td><input type="checkbox" name="torrents" value="{{ torid }}"{% if torid in moves %} checked="checked"{% endif %}></td>
<td><input type="checkbox" name="tkeys" value="{{ torid }}"{% if torid in moves %} checked="checked"{% else %} disabled="disabled"{% endif %}/></td>
<td>{{ torid[0:8] }}</td>
<td>
{{ tor.name }}<br />
@ -79,6 +79,7 @@
<div class="libraryinfo">
<details>
<summary>Library information</summary>
<h2>Shows ({{ shows|len }})</h2>
<table>
<tr>
<th>name</th>

View File

@ -45,7 +45,10 @@
</table>
<br />
<input type="submit" value="Sort">
{% if score > 0 %}<a href="/sort?tkey={{ tkey }}&score={{ score // 2 }}#bottom" class="right">show more (S={{ score }}%)</a>{% endif %}
<div class="right">
{% if score > 0 %}<a href="/sort?tkey={{ tkey }}&score={{ score // 2 }}#bottom">show more (S={{ score }}%)</a>{% endif %}
{{ matches|len }}
</div>
</fieldset>
</form>
</div>