Can you move the opus check above the ogg check and then remove the title.endsWith(".ogg") so that it falls back to OGG for weird filenames?