New Zealand Police's Online Child Exploitation unit (Oceanz) received a tip-off last year that McNair was trading in child pornography online.
An investigator posed as a collector and between June 6 and 13 last year, McNair shared 317 objectionable images as well as two videos.
A search was then carried out on his home and a multitude of devices confiscated including a laptop, cellphones, USB sticks, a GoPro and tablets.
On one SD card, police found 8790 images, 7554 of which depicted sexual violation of children as young as 2 years old.
McNair was so thorough with his collection that he categorised and catalogued it all into sections; child nudity, nudism, cartoon, fantasy, bestiality and others.
Crown prosecutor Kaleb Whyte said in the end, police discovered more than 20,000 objectionable images, a collection described as "significant".
As for the bestiality charges which he'd earlier admitted, that offending occurred sometime between October 1, 2016 and October 1, 2017.
In that time McNair was working as a farrier on a local farm and he videoed himself having sex with a heifer - a young female cow.
And sometime between August 2017 and October 2017, McNair organised a miniature horse who he then had penetrate him.
Whyte said McNair was regarded as being at a high risk of reoffending and harm to others without having specialist intervention.
Whyte said a previous case had regarded possession of 10,000 images as "extensive" and McNair's collection was more than double that.
He submitted that although he did not have any previous convictions, he should not get credit for his previous good character given the extensiveness of his collection.
McNair's counsel Sheila Cameron said he had "a deep sense of shame" over his offending that could mostly be put down to his tough childhood.
He was subjected to bullying and torment by others and was also the victim of sexual abuse as a child.
He had been undergoing counselling since his arrest in October last year and diagnosed with post traumatic stress disorder and avoidant personality disorder.
She described him living in "extreme social isolation" and he had never had an adult relationship.
He had effectively destroyed his own life by the offending which would put an end to his job working with farm animals, she said.
Judge Burnett said it was clear he still did not fully comprehend the extent of his actions by belonging to the worldwide online child pornography sharing group, Peer to Peer, who all share objectionable images.
She took umbrage with a line in his apology letter in which he stated "he would not dream" of having sex with a child.
Judge Burnett said his conduct was probably worse because he shared images and videos of others doing exactly that.
She agreed with the crown and declined to give him credit for previous good character, as well as handing down a minimum non parole period of 50 per cent.
However, she did give him credit for the work he had done in getting counselling to help him through his personal issues.
McNair was sentenced to three years and five months' jail.