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')
|
media_path = media_path.encode('utf-8')
|
||||||
if isinstance(video, unicode):
|
if isinstance(video, unicode):
|
||||||
video = video.encode('utf-8')
|
video = video.encode('utf-8')
|
||||||
|
media_path = os.path.relpath(media_path, os.path.dirname(video))
|
||||||
os.symlink(media_path, video)
|
os.symlink(media_path, video)
|
||||||
size = v.media.size
|
size = v.media.size
|
||||||
duration = v.duration
|
duration = v.duration
|
||||||
|
@ -1197,6 +1198,7 @@ class Item(models.Model):
|
||||||
media_path = media_path.encode('utf-8')
|
media_path = media_path.encode('utf-8')
|
||||||
if isinstance(video, unicode):
|
if isinstance(video, unicode):
|
||||||
video = video.encode('utf-8')
|
video = video.encode('utf-8')
|
||||||
|
media_path = os.path.relpath(media_path, os.path.dirname(video))
|
||||||
os.symlink(media_path, video)
|
os.symlink(media_path, video)
|
||||||
size += v.media.size
|
size += v.media.size
|
||||||
duration += v.duration
|
duration += v.duration
|
||||||
|
|
Loading…
Reference in a new issue