Skip to content

Commit d272ec9

Browse files
committed
Tweaks
1 parent a774a13 commit d272ec9

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

newshomepages/extract/consolidate.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
from __future__ import annotations
44

55
import json
6+
import random
67
import shutil
78
import time
89
from datetime import datetime
@@ -105,9 +106,9 @@ def consolidate(
105106
print(f"-- Reviewing {len(item_data['files'])} files for {handle}")
106107
# Print the first one for review
107108
if item_data["files"]:
108-
print(f"--- First file: {item_data['files'][0]}")
109+
print(f"--- Random file: {random.choice(item_data['files'])}")
109110
for p in item_data["files"]:
110-
if handle in p["name"].lower():
111+
if handle.lower() in p["name"].lower():
111112
# Check if the file is of a type we want
112113
if p["format"].upper() in ["JSON", "JPEG", "HTML"]:
113114
qualified_files.append(p)

0 commit comments

Comments
 (0)