mirror of
https://github.com/meeb/tubesync.git
synced 2025-06-25 14:36:34 +00:00
Rewrite the .nfo file when the thumb path changed
This commit is contained in:
parent
278a92b7e1
commit
8f0825b57f
@ -19,7 +19,7 @@ from common.utils import clean_filename, clean_emoji
|
|||||||
from .youtube import (get_media_info as get_youtube_media_info,
|
from .youtube import (get_media_info as get_youtube_media_info,
|
||||||
download_media as download_youtube_media,
|
download_media as download_youtube_media,
|
||||||
get_channel_image_info as get_youtube_channel_image_info)
|
get_channel_image_info as get_youtube_channel_image_info)
|
||||||
from .utils import seconds_to_timestr, parse_media_format
|
from .utils import seconds_to_timestr, parse_media_format, write_text_file
|
||||||
from .matching import (get_best_combined_format, get_best_audio_format,
|
from .matching import (get_best_combined_format, get_best_audio_format,
|
||||||
get_best_video_format)
|
get_best_video_format)
|
||||||
from .mediaservers import PlexMediaServer
|
from .mediaservers import PlexMediaServer
|
||||||
@ -1548,6 +1548,12 @@ class Media(models.Model):
|
|||||||
self.media_file.name = str(new_video_path.relative_to(media_file_storage.location))
|
self.media_file.name = str(new_video_path.relative_to(media_file_storage.location))
|
||||||
self.save(update_fields={'media_file'})
|
self.save(update_fields={'media_file'})
|
||||||
|
|
||||||
|
# The thumbpath inside the .nfo file may have changed
|
||||||
|
if self.source.write_nfo and self.source.copy_thumbnails:
|
||||||
|
nfo_path_tmp = Path(str(self.nfopath) + '.tmp')
|
||||||
|
write_text_file(nfo_path_tmp, self.nfoxml)
|
||||||
|
nfo_path_tmp.replace(self.nfopath)
|
||||||
|
|
||||||
|
|
||||||
class MediaServer(models.Model):
|
class MediaServer(models.Model):
|
||||||
'''
|
'''
|
||||||
|
Loading…
Reference in New Issue
Block a user