From 6853c1fa76ba0c2a26d62477f3e2a5bf2233bb2e Mon Sep 17 00:00:00 2001 From: meeb Date: Mon, 11 Dec 2023 13:42:33 +1100 Subject: [PATCH] fix tests --- tubesync/sync/models.py | 8 +++----- tubesync/sync/tests.py | 4 ++-- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/tubesync/sync/models.py b/tubesync/sync/models.py index dff8063..e5c9221 100644 --- a/tubesync/sync/models.py +++ b/tubesync/sync/models.py @@ -119,7 +119,7 @@ class Source(models.Model): ('interaction', 'Interaction Reminder'), ('music_offtopic', 'Non-Music Section'), ) - + sponsorblock_categories = CommaSepChoiceField( _(''), possible_choices=SPONSORBLOCK_CATEGORIES_CHOICES, @@ -1236,7 +1236,6 @@ class Media(models.Model): acodec = self.downloaded_audio_codec if acodec is None: raise TypeError() # nothing here. - acodec = acodec.lower() if acodec == "mp4a": return "audio/mp4" @@ -1245,7 +1244,6 @@ class Media(models.Model): else: # fall-fall-back. return 'audio/ogg' - vcodec = vcodec.lower() if vcodec == 'vp9': return 'video/webm' @@ -1281,7 +1279,8 @@ class Media(models.Model): nfo.append(season) # episode = number of video in the year episode = nfo.makeelement('episode', {}) - episode.text = str(self.calculate_episode_number()) # Remplacez par la logique de calcul + episode_number = self.calculate_episode_number() + episode.text = str(episode_number) if episode_number else '' episode.tail = '\n ' nfo.append(episode) # ratings = media metadata youtube rating @@ -1415,7 +1414,6 @@ class Media(models.Model): self_year = self.upload_date.year if self.upload_date else self.created.year filtered_media = Media.objects.filter(source=self.source, published__year=self_year) sorted_media = sorted(filtered_media, key=lambda x: (x.upload_date, x.key)) - position_counter = 1 for media in sorted_media: if media == self: diff --git a/tubesync/sync/tests.py b/tubesync/sync/tests.py index bcaf9cc..333518f 100644 --- a/tubesync/sync/tests.py +++ b/tubesync/sync/tests.py @@ -661,8 +661,8 @@ class MediaTestCase(TestCase): '', ' no fancy stuff title', ' testname', - ' 2020', - ' 1', + ' 2017', + ' ', ' ', ' ', ' 1.2345',