"""update_wanted_batch2.py — označí další vlnu foťáků wanted=TRUE, category=Rodina"""
import psycopg2

DB = dict(host="192.168.1.76", port=5432, user="vladimir.buzalka",
          password="Vlado7309208104++", database="fotky_buzalkovi")

# (make, model)
CAMERAS = [
    ("Canon",                    "Canon DIGITAL IXUS 30"),
    ("Xiaomi",                   "2201117TY"),
    ("SONY",                     "DSC-H70"),
    ("Panasonic",                "DMC-FZ20"),
    ("Panasonic",                "DMC-FZ50"),
    ("Panasonic",                "NV-GS180"),
    ("EASTMAN KODAK COMPANY",    "KODAK C875 ZOOM DIGITAL CAMERA"),
    ("SONY",                     "D2005"),
    ("OLYMPUS IMAGING CORP.",    "XZ-10"),
    ("OLYMPUS CORPORATION",      "C460ZdelSol"),
    ("Canon",                    "Canon EOS DIGITAL REBEL"),
    ("HTC",                      "HTC HD2 T8585"),
    ("OLYMPUS OPTICAL CO.,LTD",  "C4040Z"),
    ("NIKON",                    "E950"),
    ("NIKON",                    "E5400"),
    ("Canon",                    "Canon PowerShot S300"),
    ("Emgeton",                  "Flexaret Mini"),
    ("SONY",                     "DCR-PC115E"),
    ("Canon",                    "Canon PowerShot A720 IS"),
    ("SONY",                     "HDR-TG3E"),
    ("Canon",                    "Canon PowerShot A75"),
    ("OLYMPUS OPTICAL CO.,LTD",  "C3030Z"),
    ("FUJIFILM",                 "FinePix F20"),
    ("vivo",                     "vivo X100 Pro"),
    ("NIKON",                    "E3200"),
    ("Canon",                    "Canon PowerShot S3 IS"),
    ("Canon",                    "Canon PowerShot G3"),
    ("OLYMPUS OPTICAL CO.,LTD",  "X-2,C-50Z"),
    ("Canon",                    "Canon PowerShot S2 IS"),
    ("Canon",                    "Canon PowerShot S500"),
    ("Canon",                    "Canon DIGITAL IXUS 400"),
    ("OLYMPUS OPTICAL CO.,LTD",  "C5050Z"),
]

conn = psycopg2.connect(**DB)
conn.autocommit = True
cur = conn.cursor()

placeholders = ",".join(["(%s,%s)"] * len(CAMERAS))
params = [v for pair in CAMERAS for v in pair]
cur.execute(f"""
    UPDATE photos
    SET wanted   = TRUE,
        category = 'Rodina'
    WHERE (camera_make, camera_model) IN ({placeholders})
      AND wanted = FALSE
""", params)

print(f"Označeno: {cur.rowcount:,} řádků → wanted=TRUE, category='Rodina'")
conn.close()
