Пример #1
0
def update_video_index(sender, instance=None, created=False, **kwargs):
    if TEST_SETTINGS or ES_URL is None:
        return
    if instance.is_draft is False and instance.encoding_in_progress is False:
        index_es(instance)
    else:
        delete_es(instance)
Пример #2
0
 def manage_es(self, video_id):
     try:
         video = Video.objects.get(pk=video_id)
         if video.is_draft is False:
             index_es(video)
             self.stdout.write(
                 self.style.SUCCESS('Successfully index Video "%s"' %
                                    video_id))
         else:
             delete_es(video)
     except Video.DoesNotExist:
         self.stdout.write(
             self.style.ERROR('Video "%s" does not exist' % video_id))
Пример #3
0
def update_video_index(sender, instance=None, created=False, **kwargs):
    if instance.is_draft is False and instance.encoding_in_progress is False:
        index_es(instance)
    else:
        delete_es(instance)
Пример #4
0
def delete_video_index(sender, instance=None, created=False, **kwargs):
    delete_es(instance)
Пример #5
0
def delete_video_index(sender, instance=None, created=False, **kwargs):
    if TEST_SETTINGS or ES_URL is None:
        return
    delete_es(instance)
Пример #6
0
def index_video(video):
    if video.is_draft is False and video.encoding_in_progress is False:
        index_es(video)
    else:
        delete_es(video)