bus_analyzer: Fix listing segments to respect tombstones

pull/370/head
Mike Lang 1 year ago
parent 8ac6e71d48
commit c5acfe3ae0

@ -10,7 +10,7 @@ import argh
import gevent.event import gevent.event
from common import database from common import database
from common.segments import parse_segment_path from common.segments import parse_segment_path, list_segment_files
from .extract import extract_segment, load_prototypes from .extract import extract_segment, load_prototypes
@ -151,11 +151,7 @@ def analyze_segment(conn, prototypes, segment_path, check_segment_name=None):
def analyze_hour(conn, prototypes, existing_segments, base_dir, channel, quality, hour): def analyze_hour(conn, prototypes, existing_segments, base_dir, channel, quality, hour):
hour_path = os.path.join(base_dir, channel, quality, hour) hour_path = os.path.join(base_dir, channel, quality, hour)
try: segments = sorted(list_segment_files(hour_path))
segments = os.listdir(hour_path)
except FileNotFoundError:
logging.info(f"No such hour {hour_path!r}, skipping")
return
logging.info("Found {} segments for hour {!r}".format(len(segments), hour_path)) logging.info("Found {} segments for hour {!r}".format(len(segments), hour_path))
segments_to_do = [] segments_to_do = []

Loading…
Cancel
Save