Skip to content

Commit

Permalink
Merge pull request #688 from tcely/patch-2
Browse files Browse the repository at this point in the history
Remove code that didn't work
  • Loading branch information
meeb authored Feb 5, 2025
2 parents 531be5f + 459cb4b commit 3ecf1e1
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions tubesync/sync/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -586,7 +586,6 @@ def rename_all_media_for_source(source_id):

@background(schedule=0)
def wait_for_media_premiere(media_id):
td = lambda p, now=timezone.now(): (p - now)
hours = lambda td: 1+int((24*td.days)+(td.seconds/(60*60)))

try:
Expand All @@ -595,18 +594,14 @@ def wait_for_media_premiere(media_id):
return
if media.metadata:
return
if media.published < timezone.now():
now = timezone.now()
if media.published < now:
media.manual_skip = False
media.skip = False
# start the download tasks
media.save()
else:
media.manual_skip = True
media.title = _(f'Premieres in {hours(td(media.published))} hours')
task = get_media_premiere_task(str(media.pk))
if task:
task.verbose_name = _(f'Waiting for premiere of "{media.key}" '
f'in {hours(td(media.published))} hours')
task.save()
media.title = _(f'Premieres in {hours(media.published - now)} hours')
media.save()

0 comments on commit 3ecf1e1

Please sign in to comment.