

import os
import sys
import time
from common_code import kwq
from common_code.util import get_cset_match
from common_code.file_names import resolve_file_location
import json
import sys
import logging
from common_code.settings import get_logger, LogColorize
sys.path.insert(0, "/home/thebears/Source/ml/sources_mltraining/model_runner/")
from video_reduce_resolution import convert_file_with_check
from common_code import settings
default_dir_watch = settings.dir_watch


pfm = LogColorize.file_modifications
logger = get_logger(__name__,'/var/log/ml_vision_logs/20_add_into_queue', stdout=True, systemd=False, level = logging.INFO)

success_det_and_embed_topic = kwq.TOPICS.exit_60_videos_embedded



f_nav = list()
for c_dir in settings.dir_watch_archived():
    for root, _, files in  os.walk(c_dir):
        for f in files:
            if f.endswith('.mp4') and "reduced" not in f:
                cfile = os.path.join( root, f)
                f_nav.append(cfile)


# %%
#for f, _ in zip(f_nav, range(10)):
from tqdm import tqdm

    kwq.publish(success_det_and_embed_topic, f)

# %%

