Skip to content

Commit

Permalink
- Fix requeue youtube videos - mark Y/N field instead of scheduling n…
Browse files Browse the repository at this point in the history
…ew events.
  • Loading branch information
frankyrumple committed Jun 16, 2022
1 parent c79707b commit 7e80ca9
Showing 1 changed file with 16 additions and 10 deletions.
26 changes: 16 additions & 10 deletions web2py/applications/smc/controllers/media.py
Original file line number Diff line number Diff line change
Expand Up @@ -1610,20 +1610,26 @@ def yt_requeue():
if is_media_file_present(file_guid) is not True:
# Media file isn't here? Re-schedule the task
msg += "Re-queue missing YT File : " + m["youtube_url"] + " <br />"
result = scheduler.queue_task('pull_youtube_video', pvars=dict(yt_url=m["youtube_url"],
media_guid=file_guid
),
timeout=18000, immediate=True, sync_output=3,
group_name="download_videos", retry_failed=30, period=300)
m.update_record(needs_downloading=True)
db.commit()
# result = scheduler.queue_task('pull_youtube_video', pvars=dict(yt_url=m["youtube_url"],
# media_guid=file_guid
# ),
# timeout=18000, immediate=True, sync_output=3,
# group_name="download_videos", retry_failed=30, period=300)

if is_media_captions_present(file_guid) is not True:
# Re-queue captions
msg += "Re-queue missing YT Captions : " + m["youtube_url"] + " <br />"
result = scheduler.queue_task('pull_youtube_caption', pvars=dict(yt_url=m["youtube_url"],
media_guid=file_guid
),
timeout=18000, immediate=True, sync_output=3,
group_name="download_videos", retry_failed=30, period=300)
r = m.update_record(needs_caption_downloading=True)
#print(f" -- {r}")
db.commit()
#print("Done.")
# result = scheduler.queue_task('pull_youtube_caption', pvars=dict(yt_url=m["youtube_url"],
# media_guid=file_guid
# ),
# timeout=18000, immediate=True, sync_output=3,
# group_name="download_videos", retry_failed=30, period=300)


response.flash = "YouTube downloads re-queued."
Expand Down

0 comments on commit 7e80ca9

Please sign in to comment.