fix: Duplikate in Jobs-Tabelle verhindern, KTI als einziges Ziel

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Cursor 2026-02-25 14:45:50 +07:00
parent aad4e9b3c9
commit 52b71d16f4

View file

@ -123,14 +123,16 @@ HINWEIS: [Falls Preis unter 600 EUR verdächtig günstig, darauf hinweisen]'
('flugscanner-mu', '100.75.182.15', 'Muldenstein DE')
""")
# Standard-Jobs: Frankfurt → Phnom Penh (KTI), Premium Economy, Roundtrip
# HAN ist Umstieg — wird automatisch als günstigste Verbindung gefunden
c.execute("""
INSERT OR IGNORE INTO jobs (scanner, von, nach, tage, aufenthalt_tage, trip_type, kabine, intervall) VALUES
('google_flights', 'FRA', 'KTI', 30, 14, 'roundtrip', 'premium_economy', 'daily'),
('kayak', 'FRA', 'KTI', 30, 14, 'roundtrip', 'premium_economy', 'daily'),
('trip', 'FRA', 'KTI', 30, 14, 'roundtrip', 'premium_economy', 'daily')
""")
# Standard-Jobs nur einfügen wenn noch gar keine Jobs vorhanden
# Verhindert Duplikate bei Container-Neustarts
job_count = c.execute("SELECT COUNT(*) FROM jobs").fetchone()[0]
if job_count == 0:
c.execute("""
INSERT INTO jobs (scanner, von, nach, tage, aufenthalt_tage, trip_type, kabine, intervall) VALUES
('google_flights', 'FRA', 'KTI', 30, 14, 'roundtrip', 'premium_economy', 'daily'),
('kayak', 'FRA', 'KTI', 30, 14, 'roundtrip', 'premium_economy', 'daily'),
('trip', 'FRA', 'KTI', 30, 14, 'roundtrip', 'premium_economy', 'daily')
""")
conn.commit()
conn.close()