From 3fb494155c993b9efe637890d905c22ac1f59343 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20=C3=96nnerby?= Date: Sat, 27 Dec 2008 00:11:31 +0000 Subject: [PATCH] FIXED: Bug trying to read tags from remote files. --- src/core/NonLibraryTrackHelper.cpp | 41 ++++++++++++++++-------------- 1 file changed, 22 insertions(+), 19 deletions(-) diff --git a/src/core/NonLibraryTrackHelper.cpp b/src/core/NonLibraryTrackHelper.cpp index c100161fb..804676dd9 100644 --- a/src/core/NonLibraryTrackHelper.cpp +++ b/src/core/NonLibraryTrackHelper.cpp @@ -40,6 +40,7 @@ #include #include #include +#include ////////////////////////////////////////////////////////////////////////////// @@ -114,30 +115,32 @@ void NonLibraryTrackHelper::ThreadLoop(){ } } if(track){ - utfstring url(track->URL()); - utfstring::size_type lastDot = url.find_last_of(UTF(".")); - if(lastDot!=utfstring::npos){ - track->SetValue("extension",url.substr(lastDot+1).c_str()); - } - // Read track metadata - typedef MetadataReaderList::iterator Iterator; - Iterator it = metadataReaders.begin(); - while (it != metadataReaders.end()) { - if((*it)->CanReadTag(track->GetValue("extension")) ){ - // Should be able to read the tag - if( (*it)->ReadTag(track.get()) ){ - // Successfully read the tag. -// tagRead=true; + // check if this is a local file + if(musik::core::filestreams::Factory::IsLocalFileStream(track->URL())){ + utfstring url(track->URL()); + utfstring::size_type lastDot = url.find_last_of(UTF(".")); + if(lastDot!=utfstring::npos){ + track->SetValue("extension",url.substr(lastDot+1).c_str()); + } + // Read track metadata + typedef MetadataReaderList::iterator Iterator; + Iterator it = metadataReaders.begin(); + while (it != metadataReaders.end()) { + if((*it)->CanReadTag(track->GetValue("extension")) ){ + // Should be able to read the tag + if( (*it)->ReadTag(track.get()) ){ + // Successfully read the tag. + // tagRead=true; + } } + + it++; } - it++; + // Lets notify that tracks has been read + this->TrackMetadataUpdated(track); } - - // Lets notify that tracks has been read - this->TrackMetadataUpdated(track); } - } }