If diamond king is offside good defense can now set you what ever you try.
Now you have to make sure that you get 5 spades 3 hearts and 2 diamonds. You run spades next and if opponents makes mistake to ruff you are probably going to make.
If no ruff you need to get to end position where you have dummy with x JT Qx x and your hand with - xx AJ Q. If opponent ruffs now they are endplayed to give you try for diamond finesse. If LHO didn't ruff you just take diamond finesse. You will only lose 2 hearts and a club when playing this way if finesse works.
This line also gives extra chance if your opponent makes mistake to ruff and holds AK clubs and diamond king.
If you get a spade ruff early you can just run spades and discard diamonds and then take 10th trick with diamond ruff it is very unlikely that your opps will find club to RHO and diamond shift without cashing the trump queen. But if they find that then you are again depending on diamond king onside.
If scoring is MP then I'm not sure what to do. You can see that spade players are makeing 10 or 11 tricks. Iit seems like you can just try to lure opps to miss defend by playing trumps now and later choose if you take diamond finesse or not. If that doesn't work just take the next board.
Anyway, The intreting queston is why you missed your 9 card spade fit. Seems like MP contract trying for max if everything is nicely or opps fail to cash their minor tricks.
PS. Free has the point that thinking break was before playing the trumps