06ee0ea00b
- Added frequency in Video Settings - Cron job to check half hourly job - Hourly job to run job based on frequency - Patch to set youtube id in video for ease in computing
8 lines
357 B
Python
8 lines
357 B
Python
from __future__ import unicode_literals
|
|
import frappe
|
|
from erpnext.utilities.doctype.video.video import get_id_from_url
|
|
|
|
def execute():
|
|
for video in frappe.get_all("Video", fields=["name", "url", "youtube_video_id"]):
|
|
if video.url and not video.youtube_video_id:
|
|
frappe.db.set_value("Video", video.name, "youtube_video_id", get_id_from_url(video.url)) |