From 7f96b34e54ca2051c3552d01954693c42fc24e39 Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Wed, 18 Apr 2012 11:11:12 +0200 Subject: [PATCH] fix torrent path, set rendered to false if uploading again --- pandora/archive/models.py | 2 +- pandora/archive/views.py | 2 ++ pandora/item/models.py | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/pandora/archive/models.py b/pandora/archive/models.py index 602293f79..cc4c43ff0 100644 --- a/pandora/archive/models.py +++ b/pandora/archive/models.py @@ -149,7 +149,7 @@ class File(models.Model): def save(self, *args, **kwargs): if self.auto: self.set_state() - self.sort_path= utils.sort_string(self.path) + self.sort_path = utils.sort_string(self.path) if self.is_subtitle: self.available = self.data and True or False else: diff --git a/pandora/archive/views.py b/pandora/archive/views.py index 07652a41d..74c2cdd39 100644 --- a/pandora/archive/views.py +++ b/pandora/archive/views.py @@ -255,6 +255,8 @@ def firefogg_upload(request): f.delete_frames() f.uploading = True f.save() + if f.item.rendered and f.selected: + Item.objects.filter(id=f.item.id).update(rendered=False) response = { 'uploadUrl': request.build_absolute_uri('/api/upload/?id=%s&profile=%s' % (f.oshash, profile)), 'url': request.build_absolute_uri('/%s' % f.item.itemId), diff --git a/pandora/item/models.py b/pandora/item/models.py index f9c04819c..95f078e3b 100644 --- a/pandora/item/models.py +++ b/pandora/item/models.py @@ -1009,7 +1009,7 @@ class Item(models.Model): meta['piece_size_pow2'] = piece_size_pow2 ox.torrent.createTorrent(video, settings.TRACKER_URL, meta) - self.torrent.name = self.path('torrent/%s.torrent' % self.get('title')) + self.torrent.name = torrent[len(settings.MEDIA_ROOT)+1:] self.save() def streams(self):