force recheck when toggling premiere mode

This commit is contained in:
fake 2020-05-18 14:46:21 -07:00
parent 38f1c82fb5
commit ee76a95ddb
1 changed files with 4 additions and 1 deletions

View File

@ -26,9 +26,11 @@ class Core(CorePluginBase):
@export
def add_premiere_torrent(self, torr):
self.premiere_torrents[torr] = True
tor_handle = component.get("TorrentManager").torrents[torr].handle
tor = component.get("TorrentManager").torrents[torr]
tor_handle = tor.handle
for i in range(1, tor_handle.get_torrent_info().num_pieces()+1):
tor_handle.set_piece_premiere(i, True)
tor.force_recheck()
@export
def del_premiere_torrent(self, torr):
@ -40,6 +42,7 @@ class Core(CorePluginBase):
tor_handle = tor.handle
for i in range(tor_handle.get_torrent_info().num_pieces()+1):
tor_handle.set_piece_premiere(i, False)
tor.force_recheck()
@export
def is_premiere_torrent(self, torr):