# HG changeset patch # User Sebastian Brannstrom # Date 1287257625 -3600 # Node ID f02d87cb8d1fd5802bec06d11332ca5482f10f90 # Parent f5377b5817a003ffac8480318f909c7eeca6c576 Fix for bug 3420 - we now use GUID if it's provided by the feed diff -r f5377b5817a0 -r f02d87cb8d1f engine/inc/FeedParser.h --- a/engine/inc/FeedParser.h Sat Oct 16 20:10:01 2010 +0100 +++ b/engine/inc/FeedParser.h Sat Oct 16 20:33:45 2010 +0100 @@ -35,6 +35,7 @@ _LIT(KTagChannel, "channel"); _LIT(KTagEnclosure, "enclosure"); _LIT(KTagPubDate, "pubDate"); +_LIT(KTagGuid, "guid"); _LIT(KTagLastBuildDate, "lastBuildDate"); _LIT(KTagHref, "href"); @@ -52,7 +53,8 @@ EStateItemLink, EStateItemEnclosure, EStateItemDescription, - EStateItemPubDate + EStateItemPubDate, + EStateItemGuid }; enum TEncoding { @@ -93,7 +95,7 @@ CFeedInfo *iActiveFeed; TBuf iBuffer; - + TUint iUid; TUint iMaxItems; TUint iItemsParsed; TBool iStoppedParsing; diff -r f5377b5817a0 -r f02d87cb8d1f engine/src/FeedParser.cpp --- a/engine/src/FeedParser.cpp Sat Oct 16 20:10:01 2010 +0100 +++ b/engine/src/FeedParser.cpp Sat Oct 16 20:33:45 2010 +0100 @@ -24,6 +24,7 @@ #include #include #include +#include #include "debug.h" #include "podcastutils.h" @@ -159,6 +160,7 @@ } break; case EStateItem: + iUid = 0; // if (str.CompareF(KTagTitle) == 0) { iFeedState=EStateItemTitle; @@ -197,6 +199,9 @@ } else if (str.CompareF(KTagPubDate) == 0) { //DP("LastBuildDate BEGIN"); iFeedState = EStateItemPubDate; + // <channel> <item> <guid> + } else if (str.CompareF(KTagGuid) == 0) { + iFeedState = EStateItemGuid; } break; default: @@ -273,9 +278,7 @@ case EStateItem: if (str.CompareF(KTagItem) == 0) { - // check if we have a valid pubdate - if (iActiveShow->PubDate().Int64() == 0) { // set pubDate to present time @@ -292,6 +295,10 @@ iActiveShow->SetPubDate(now); } + if (iUid) + { + iActiveShow->SetUid(iUid); + } iCallbacks.NewShowL(*iActiveShow); @@ -386,6 +393,10 @@ } iFeedState=EStateItem; break; + case EStateItemGuid: + iUid = DefaultHash::Des16(iBuffer); + iFeedState=EStateItem; + break; case EStateItemTitle: //DP1("title: %S", &iBuffer); iActiveShow->SetTitleL(iBuffer);