forked from 0x2620/pandora
make links relative
This commit is contained in:
parent
679160e641
commit
68e4ac8f56
1 changed files with 2 additions and 0 deletions
|
@ -1182,6 +1182,7 @@ class Item(models.Model):
|
|||
media_path = media_path.encode('utf-8')
|
||||
if isinstance(video, unicode):
|
||||
video = video.encode('utf-8')
|
||||
media_path = os.path.relpath(media_path, os.path.dirname(video))
|
||||
os.symlink(media_path, video)
|
||||
size = v.media.size
|
||||
duration = v.duration
|
||||
|
@ -1197,6 +1198,7 @@ class Item(models.Model):
|
|||
media_path = media_path.encode('utf-8')
|
||||
if isinstance(video, unicode):
|
||||
video = video.encode('utf-8')
|
||||
media_path = os.path.relpath(media_path, os.path.dirname(video))
|
||||
os.symlink(media_path, video)
|
||||
size += v.media.size
|
||||
duration += v.duration
|
||||
|
|
Loading…
Reference in a new issue