match places/events in any case, update url-list in torrent to match current url
This commit is contained in:
parent
7140d4c3f5
commit
06069b71e2
4 changed files with 19 additions and 10 deletions
|
|
@ -901,6 +901,14 @@ class Item(models.Model):
|
|||
self.update_timeline()
|
||||
break
|
||||
|
||||
def get_torrent(self, request):
|
||||
if self.torrent:
|
||||
self.torrent.seek(0)
|
||||
data = ox.torrent.bdecode(self.torrent.read())
|
||||
url = request.build_absolute_uri("%s/torrent/"%self.get_absolute_url())
|
||||
data['url-list'] = ['%s%s' % (url, u.split('torrent/')[1]) for u in data['url-list']]
|
||||
return ox.torrent.bencode(data)
|
||||
|
||||
def make_torrent(self):
|
||||
streams = self.streams()
|
||||
if streams.count() == 0:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue