Differentiation between COD (direct object) and COI (indirect object) can be tedious, but once you've understood the basic rules, things get a lot simpler!
With infinitives you can either attach the object pronoun to the end of the infinitive or put it before the first conjugated verb. With sentences that include a present participle, you can either ...
Indirect object pronouns are the same as direct object pronouns, apart from lui (to him/her) and leur (to them.) ...