BibLaTeX: How to catch author's name for categories?

I've been trying to implement author name categories in BibLaTeX based on this answer while using biber. However, I don't seem to be able to catch the author name using \iffieldequalstr in \AtEveryBibItem:

\DeclareBibliographyCategory{authorSmith}



When I issue the \printbibliography[category=authorSmith] command, nothing is printed from the bibliography.

Here's a MWE showing the issue and all the name combinations I could think of, and how it doesn't happen when with year:

mwe.tex

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[sorting=none]{biblatex}

\DeclareBibliographyCategory{authorSmith}

\DeclareBibliographyCategory{year1984}

\begin{document}

\nocite{*}

\printbibliography

\section*{Sorted by Author}

\printbibliography[category=authorSmith]

\section*{Sorted by Year}

\printbibliography[category=year1984]

\end{document}


mwe.bib

@article{smith:TestPaper,
addendum = {This should show up},
author = {Smith, John},
journal = {Test Journal},
year = {1984},
title = {Test Paper}
}


Does anyone know how I can catch the author's name? I have similar issues with source maps.

Name fields are special and can not be tested with \iffieldequalstr. In my opinion the best way to test for a certain name is by testing with name hashes, see Highlight an author in bibliography using biblatex allowing bibliography style to format it. There are some subtleties if we do that, though, we can test for the full author list or just for one name in the author list. It is slightly simpler to test for the full list and your usage example looks like that might be intended anyway, so I will present that solution here.

The downside of this approach is that you have to look up the namehash in the .bbl once. Just open the .bbl, search for the relevant entry and copy the namehash value.

\entry{smith:TestPaper}{article}{}
\name{author}{1}{}{%
{{uniquename=0,uniquepart=base,hash=5d0ddda3a367ceb26fbaeca02e391c22}{%
family={Smith},
familyi={S\bibinitperiod},
given={John},
giveni={J\bibinitperiod},
givenun=0}}%
}
\strng{namehash}{5d0ddda3a367ceb26fbaeca02e391c22}


Shows that in my Biber version the hash for Smith, John/John Smith is 5d0ddda3a367ceb26fbaeca02e391c22. So that is what we are going to test against.

\documentclass[british]{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{babel}
\usepackage{csquotes}

\usepackage[style=authoryear, backend=biber]{biblatex}

\DeclareBibliographyCategory{authorSmith}

\AtDataInput{%
\iffieldequalstr{namehash}{5d0ddda3a367ceb26fbaeca02e391c22}
{}}

\usepackage{filecontents}
\begin{filecontents}{\jobname.bib}
@article{smith:TestPaper,
addendum = {This should show up},
author   = {Smith, John},
journal  = {Test Journal},
year     = {1984},
title    = {Test Paper},
}
\end{filecontents}