Commit 85b8209c authored by Frerich Raabe's avatar Frerich Raabe

- Don't compare with the filename extensions to figure out whether we need

  to use an ID3Tag or an OggTag, but use KMimeType::findByURL()

svn path=/trunk/kdemultimedia/juk/; revision=214738
parent 0a9745dc
...@@ -16,6 +16,7 @@ ...@@ -16,6 +16,7 @@
***************************************************************************/ ***************************************************************************/
#include <kdebug.h> #include <kdebug.h>
#include <kmimetype.h>
#include <qregexp.h> #include <qregexp.h>
...@@ -39,10 +40,14 @@ Tag *Tag::createTag(const QString &file, bool ignoreCache) ...@@ -39,10 +40,14 @@ Tag *Tag::createTag(const QString &file, bool ignoreCache)
if(cachedItem) if(cachedItem)
return cachedItem; return cachedItem;
if(file.lower().endsWith("mp3")) KMimeType::Ptr result = KMimeType::findByURL(file, 0, true /* local file */);
if(!result)
return 0;
if(result->name() == "audio/x-mp3")
return new ID3Tag(file); return new ID3Tag(file);
if(file.lower().endsWith("ogg")) if(result->name() == "application/x-ogg")
return new OggTag(file); return new OggTag(file);
return 0; return 0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment