FR 189 then AA 8679 at Madrid
Edinburgh → Madrid → Porto
Timetable, Madrid time
12:20FR 189 from Edinburgh at the gate
11:25AA 8679 to Porto leaves the gate
23 h 05 apart on the timetable, overnight
AA 8679 leaves 23 h 05 after FR 189 arrives on the timetable: more than half a day, so not a connection we count.