Merge branch 'meeb:main' into main-extractChannelThumbnail

This commit is contained in:
Someone 2023-12-11 15:42:12 +01:00 committed by GitHub
commit 630f756fa6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 7 deletions

View File

@ -1252,7 +1252,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"
@ -1261,7 +1260,6 @@ class Media(models.Model):
else:
# fall-fall-back.
return 'audio/ogg'
vcodec = vcodec.lower()
if vcodec == 'vp9':
return 'video/webm'
@ -1297,7 +1295,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
@ -1431,7 +1430,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:

View File

@ -661,8 +661,8 @@ class MediaTestCase(TestCase):
'<episodedetails>',
' <title>no fancy stuff title</title>',
' <showtitle>testname</showtitle>',
' <season>2020</season>',
' <episode>1</episode>',
' <season>2017</season>',
' <episode></episode>',
' <ratings>',
' <rating default="True" max="5" name="youtube">',
' <value>1.2345</value>',