# HG changeset patch # User teknolog # Date 1272319721 -3600 # Node ID 50edf2be6f0dbb1c335adc00eec6fd337e0d5306 # Parent dd31cab34e2757054a79899a40ddc7d66e07eadd Crude video file detection implemented diff -r dd31cab34e27 -r 50edf2be6f0d engine/inc/PodcastUtils.h --- a/engine/inc/PodcastUtils.h Mon Apr 26 22:11:45 2010 +0100 +++ b/engine/inc/PodcastUtils.h Mon Apr 26 23:08:41 2010 +0100 @@ -32,7 +32,13 @@ _LIT(KURLPrefix, "http://"); _LIT(KItpcPrefix, "itpc://"); -_LIT(KPcastPrefix, "pcast://"); +_LIT(KPcastPrefix, "pcast://"); + +_LIT(KVideoFormat1, ".wmv"); +_LIT(KVideoFormat2, ".avi"); +_LIT(KVideoFormat3, ".mp4"); + + class PodcastUtils { @@ -46,6 +52,7 @@ IMPORT_C static void SQLEncode(TDes &aString); IMPORT_C static void XMLEncode(TDes &aString); IMPORT_C static void RemoveAllFormatting(TDes & aString); + IMPORT_C static TBool IsVideoShow(TDesC &aUrl); }; #endif /* PODCASTUTILS_H_ */ diff -r dd31cab34e27 -r 50edf2be6f0d engine/src/FeedParser.cpp --- a/engine/src/FeedParser.cpp Mon Apr 26 22:11:45 2010 +0100 +++ b/engine/src/FeedParser.cpp Mon Apr 26 23:08:41 2010 +0100 @@ -25,6 +25,7 @@ #include #include #include "debug.h" +#include "podcastutils.h" using namespace Xml; const TInt KMaxParseBuffer = 1024; @@ -176,6 +177,10 @@ HBufC* val16 = HBufC::NewLC(KMaxParseBuffer); val16->Des().Copy(attr.Value().DesC()); iActiveShow->SetUrlL(*val16); + + if (PodcastUtils::IsVideoShow(*val16)) { + iActiveShow->SetShowType(EVideoPodcast); + } CleanupStack::PopAndDestroy(val16); // length=... } else if (attr16.Compare(KTagLength) == 0) { @@ -369,6 +374,10 @@ case EStateItemLink: if (iActiveShow->Url().Length() == 0) { iActiveShow->SetUrlL(iBuffer); + + if (PodcastUtils::IsVideoShow(iBuffer)) { + iActiveShow->SetShowType(EVideoPodcast); + } } iFeedState = EStateItem; break; diff -r dd31cab34e27 -r 50edf2be6f0d engine/src/PodcastUtils.cpp --- a/engine/src/PodcastUtils.cpp Mon Apr 26 22:11:45 2010 +0100 +++ b/engine/src/PodcastUtils.cpp Mon Apr 26 23:08:41 2010 +0100 @@ -306,3 +306,15 @@ ReplaceString(aString, _L(">"), _L(">")); ReplaceString(aString, _L("&"), _L("&")); } + +EXPORT_C TBool PodcastUtils::IsVideoShow(TDesC &aUrl) + { + if (aUrl.Find(KVideoFormat1) != KErrNotFound || + aUrl.Find(KVideoFormat2) != KErrNotFound || + aUrl.Find(KVideoFormat3) != KErrNotFound) + { + return ETrue; + } + + return EFalse; + }