metabrainz / picard-plugins

Picard plugins: use 1.0 branch for Picard < 2.0 (python 2/Qt4) and 2.0 branch for Picard >= 2.0 (python 3/Qt5)
https://picard.musicbrainz.org/plugins/
145 stars 95 forks source link

Replaygain type detection #353

Closed phw closed 1 year ago

phw commented 1 year ago

The replaygain2 plugin does not detect Ogg Vorbis files as supported because it checks whether the first extension defined in File.EXTENSIONS is contained in a whitelist of supported file types.

But in Picard the OggVorbisFile file class as an empty EXTENSIONS, as ".ogg" is a generic extension used for various formats using the Ogg container. EXTENSIONS is meant for Picard's format detection logic.

Hence replace the extension based detection with a proper type check checking for the Picard file type being used.