A compactness result for inhomogeneous nonlinear Schrödinger equations. (February 2022)