Possible to exclude mp3 files when flac files are available?



I have a decent sized music library on a media server I’ve pointed Kodi to. A good sized chunk of albums I have in flac format, and also have in mp3 format for other devices. For these albums, the songs are duplicated. Is there a way to exclude mp3 files if flac files are available? From what I’ve looked at I can include a .nomedia file in these duplicate folders to have Kodi ignore them, but if there is a less manual way I can do this I would prefer that.
Thanks!