symlink stream if item has only one video file, update imdb in background
This commit is contained in:
parent
ccddcae5e5
commit
46d02853ce
1 changed files with 18 additions and 14 deletions
|
@ -146,9 +146,9 @@ def get_item(info):
|
|||
'year': info.get('year', '')
|
||||
}
|
||||
#FIXME: this should be done async
|
||||
#item.save()
|
||||
#tasks.update_imdb.delay(item.itemId)
|
||||
item.update_imdb()
|
||||
item.save()
|
||||
tasks.update_imdb.delay(item.itemId)
|
||||
#item.update_imdb()
|
||||
tasks.update_poster.delay(item.itemId)
|
||||
else:
|
||||
q = Item.objects.filter(find__key='title', find__value=info['title'])
|
||||
|
@ -652,7 +652,9 @@ class Item(models.Model):
|
|||
stream, created = Stream.objects.get_or_create(item=self, profile='%s.webm' % settings.VIDEO_PROFILE)
|
||||
stream.video.name = stream.path()
|
||||
cmd = []
|
||||
print files
|
||||
if os.path.exists(stream.video.path):
|
||||
os.unlink(stream.video.path)
|
||||
if len(files) > 1:
|
||||
for f in sorted(files):
|
||||
cmd.append('+')
|
||||
cmd.append(files[f])
|
||||
|
@ -663,6 +665,8 @@ class Item(models.Model):
|
|||
p = subprocess.Popen(cmd, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
||||
#p = subprocess.Popen(cmd, stdin=subprocess.PIPE)
|
||||
p.wait()
|
||||
else:
|
||||
os.symlink(files[0], stream.video.path)
|
||||
stream.save()
|
||||
|
||||
if 'video' in stream.info:
|
||||
|
|
Loading…
Reference in a new issue