Print out the resolution name

Help make sure something like b2d8313 doesnt happen again
This commit is contained in:
Derek Schmidt 2018-06-12 09:57:59 -07:00
parent b2d83131be
commit 6262e7c3aa
Signed by: skeh
GPG key ID: 0F5D491793B4035A

View file

@ -35,6 +35,9 @@ class Resolution:
else:
raise ValueError("Did not recongnize resolution name. See Resolution.names")
def getNormalizedName(self):
return self.family[0]
# Rich comparison support
def __lt__(self, other):
if not isinstance(other, Resolution):
@ -168,7 +171,7 @@ def main(config_path='config.json', seen_path='seen.txt'):
if len(torrents) > 0:
best_entry = sorted(torrents, key=lambda t: t.quality, reverse=True)[0]
# Output the magnet / torrent link
printe("Choosing {torrent} as best choice for {show}".format(torrent=torrent.id, show=show.name))
printe("Choosing {torrent} as best choice for {show} (quality: {res})".format(torrent=best_entry.id, show=show.name, res=best_entry.quality.getNormalizedName()))
# TODO: transmission-cli subprocess call here?
print(best_entry.link)
else: