From: yomguy Date: Thu, 28 Feb 2013 09:53:15 +0000 (+0100) Subject: fix related media parsing X-Git-Tag: 1.4.5~42^2~1 X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=892b61ab10df8393bfa6bf52797a5127cac1982f;p=telemeta.git fix related media parsing --- diff --git a/telemeta/models/media.py b/telemeta/models/media.py index 1bc4bd25..1d5087bf 100644 --- a/telemeta/models/media.py +++ b/telemeta/models/media.py @@ -488,44 +488,22 @@ class MediaItemRelated(MediaRelated): item = ForeignKey('MediaItem', related_name="related", verbose_name=_('item')) -<<<<<<< HEAD def save(self, force_insert=False, force_update=False, using=False): super(MediaItemRelated, self).save(force_insert, force_update) def parse_markers(self, **kwargs): # Parse KDEnLive session - if self.is_kdenlive_session(): - session = KDEnLiveSession(self.file.path) - markers = session.markers(**kwargs) - for marker in markers: - m = MediaItemMarker(item=self.item) - m.public_id = get_random_hash() - m.time = float(marker['time']) - m.title = marker['comment'] - m.save() - return markers -======= - def save(self, force_insert=False, force_update=False, author=None): - super(MediaItemRelated, self).save(force_insert, force_update) - - # Parse KDEnLive session (first marker is the title of the item, - # marker author given as a keyword) if self.file: if self.is_kdenlive_session(): session = KDEnLiveSession(self.file.path) - markers = session.markers_relative() - i = 0 + markers = session.markers(**kwargs) for marker in markers: - if i == 0: - self.item.title = marker['comment'] - self.item.save() m = MediaItemMarker(item=self.item) m.public_id = get_random_hash() m.time = float(marker['time']) m.title = marker['comment'] m.save() - i += 1 ->>>>>>> ee1246c... fix related media parsing when no file (closes: #106) + return markers class Meta(MetaCore): db_table = 'media_item_related'