For your situation it would be a “one line code” change (not really, but ok, the meaning is “pretty simple” and there I agree).
However, there are so many situations that would be difficult to handle, require lots of code, testing, …
Files and sonarr are installed on one machine, you’re opening the sonarr interface from another. Now what?
Files are on you NAS, sonarr on your local machine.
Multiple machine setup with different operating systems. How to determine the path to open? Does the other machine even have access to the share? Is there a share?
People accessing sonarr from outside their local network. All the fun of firewalls, VPN, port forwarding, …
Settings > Media Management > (enable Advanced Settings) > Delete Empty Folders should help a little…