Bug 119911 - podcast update won't work for chronologically ordered feeds
Summary: podcast update won't work for chronologically ordered feeds
Status: RESOLVED FIXED
Alias: None
Product: amarok
Classification: Applications
Component: Podcast (show other bugs)
Version: 1.3.7
Platform: Mandriva RPMs Linux
: NOR wishlist
Target Milestone: ---
Assignee: Amarok Developers
URL:
Keywords:
: 129799 (view as bug list)
Depends on:
Blocks:
 
Reported: 2006-01-11 10:27 UTC by Stephen Douglas
Modified: 2006-07-27 14:20 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Stephen Douglas 2006-01-11 10:27:55 UTC
Version:           1.3.7 (using KDE KDE 3.5.0)
Installed from:    Mandriva RPMs
OS:                Linux

Podcast items are displayed in the order they are presented in the podcast feed, rather than being sorted. This causes a problem with some feeds that sort their items in non-chronological orders, such as:

http://www.lastminutecomedy.com/podcast/rss.xml

Some feeds also include a promo as the first item in an otherwise chronologically ordered feed, for example:

http://www.thejerkyshop.com/twistedpickle/rss.xml

It would be better if these feeds were sorted on the pubDate field before being displayed.
Comment 1 Seb Ruiz 2006-03-13 13:02:13 UTC
You see, this is the problem exactly with podcasting. Podcast producers should learn a little bit about common sense, they should order them chronologically.

Anyway, it would be impossible, considering every other podcaster and his publication app likes to format dates in a different way.  Not to mention languages...

Complain to the producer, sorry!
Comment 2 Stephen Douglas 2006-03-13 13:09:55 UTC
Actually, the RSS specification states that the date in a pubDate field must conform to RFC 822. 

See http://blogs.law.harvard.edu/tech/rss for more information.
Comment 3 Seb Ruiz 2006-03-14 04:31:28 UTC
This would require trawling through the entire xml feed to find if any other random entries had been added somewhere.  this also means that when a podcaster doesn't flush old items, we can go through hundreds of useless items.

bit of a catch 22...
Comment 4 Simon Walter 2006-06-05 18:43:39 UTC
Don't you think this answer is a bit lame?
Fetching the podcast is not done very often, the pubDate shows if something has changed and parsing the whole document isn't really a time consuming task.

xml and rss don't guarantee any order of elements, so if you parse such a document you can't expect the newest item at the top.
The podcast i listen to, adds new entry add the end, which is perfect valid but amarok won't recognize them unless i delete the podcast a add it again.

this behaviour of amarok simply renders it useless for some podcasts.
Comment 5 Seb Ruiz 2006-06-26 11:41:52 UTC
*** Bug 129799 has been marked as a duplicate of this bug. ***
Comment 6 arne anka 2006-06-29 11:31:07 UTC
same problem here with amarok 1.4.0 of debian/unstable.

> Don't you think this answer is a bit lame?

full ack. i'm subscribed to a feed that contains always the ten last items (counted from the current date) but amarok does not update after adding the feed.
switching from "several different date-formats we probably won't recognize" to "far to much info in feed" after #2 is not really convincing.
i don't know much about the internals of podcasts -- but an answer like "there are several other items on my todo-list with much higher priority" would always be better than plain rejection without   comprehensible reasons.

to stress #4: not updating a feed makes amarok unusable as podcast-application!
Comment 7 Seb Ruiz 2006-06-29 11:54:03 UTC
seriously, arne, you're getting a little on my nerves.  Sure, currently there are some limitations due to the way that producers release podcasts, and yes, they are valid.

That is why this bug is marked as NEW.

It means that sometime in the future it will be fixed, and yes, right now there are more important things to do, like pass university, earn money and have some fun.
Comment 8 Seb Ruiz 2006-07-19 15:06:25 UTC
SVN commit 564160 by seb:

* podcastbundle gets a QDateTime
* no longer stop checking podcast feeds after we have encountered one which has been seen before, and hence fixes bug where items are not chronological
* some regressions introduced, eg, removed feeds will come back on a re-fetch. DB alteration needed to fix this, coming soon
BUG: 119911


 M  +7 -27     contextbrowser.cpp  
 M  +1 -3      mediadevice/ipod/ipodmediadevice.cpp  
 M  +2 -1      playlistbrowser.cpp  
 M  +20 -4     playlistbrowseritem.cpp  
 M  +4 -3      playlistbrowseritem.h  
 M  +10 -3     podcastbundle.h  
Comment 9 Seb Ruiz 2006-07-20 15:58:12 UTC
SVN commit 564581 by seb:

* Sort podcast episodes in the playlistbrowser by date, and not by insertion, to handle crappy feeds such as "KonqCast" and "Children of the Gods" - hooray!
CCBUG: 119911


 M  +1 -3      playlistbrowseritem.cpp  
 M  +0 -2      playlistbrowseritem.h  
 M  +2 -1      podcastbundle.h  


--- trunk/extragear/multimedia/amarok/src/playlistbrowseritem.cpp #564580:564581
@@ -1975,12 +1975,10 @@
 int
 PodcastEpisode::compare( QListViewItem* item, int col, bool ascending ) const
 {
-    DEBUG_BLOCK
     if ( item->rtti() == PodcastEpisode::RTTI )
     {
-        debug() << "okay, its a podcast" << endl;
         #define item static_cast<PodcastEpisode*>(item)
-        return m_bundle.dateTime() < item->m_bundle.dateTime() ? -1 : 1;
+        return m_bundle.dateTime() < item->m_bundle.dateTime() ? 1 : -1;
         #undef item
     }
 
--- trunk/extragear/multimedia/amarok/src/playlistbrowseritem.h #564580:564581
@@ -338,8 +338,6 @@
 
         enum MediaFetch{ STREAM=0, AUTOMATIC=1 };
 
-        void sortChildItems( int /*column*/, bool /*ascending*/ ) { /* Don't sort its children */ }; //reimplemented
-
         void setNew( const bool n = true );
         bool hasNew() { return m_new; }
 
--- trunk/extragear/multimedia/amarok/src/podcastbundle.h #564580:564581
@@ -240,7 +240,8 @@
 inline void    PodcastEpisodeBundle::setTitle( const QString &t )       { m_title = t; }
 inline void    PodcastEpisodeBundle::setSubtitle( const QString &t )    { m_subtitle = t; }
 inline void    PodcastEpisodeBundle::setDescription( const QString &d ) { m_description = d; }
-inline void    PodcastEpisodeBundle::setDate( const QString &d )        { m_date = d; }
+inline void    PodcastEpisodeBundle::setDate( const QString &d )
+               { m_date = d; m_dateTime.setTime_t( KRFCDate::parseDate( d ) );}
 inline void    PodcastEpisodeBundle::setType( const QString &t )        { m_type = t; }
 inline void    PodcastEpisodeBundle::setDuration( const int i )         { m_duration = i; }
 inline void    PodcastEpisodeBundle::setSize( const uint i )            { m_size = i; }
Comment 10 kdebugs 2006-07-27 14:14:41 UTC
Same problem still in amarok 1.4.1

The feeds of WDR contains chronologically sorted entries, but the youngest entries are at the end of the file. The feeds contain the correct PubDate-Tag, but Amarok does not recognize it.

For example: http://www.wdr.de/radio/wdr2/podcast/wdr_2_stichtag_im_wdr_2_-_radio_zum_mitnehmen_xml.phtml
Comment 11 Seb Ruiz 2006-07-27 14:20:41 UTC
Of course it doesn't work - this was fixed after 1.4.1 was released.