Skip to content

Commit

Permalink
upload_date is set by metadata and is not a filterable field
Browse files Browse the repository at this point in the history
  • Loading branch information
meeb committed Jul 18, 2024
1 parent ebbf654 commit 623867e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion tubesync/sync/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -1480,7 +1480,8 @@ def calculate_episode_number(self):
sorted_media = Media.objects.filter(source=self.source)
else:
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, upload_date__isnull=False)
filtered_media = Media.objects.filter(source=self.source, published__year=self_year)
filtered_media = [m for m in filtered_media where m.upload_date is not None]
sorted_media = sorted(filtered_media, key=lambda x: (x.upload_date, x.key))
position_counter = 1
for media in sorted_media:
Expand Down

0 comments on commit 623867e

Please sign in to comment.