Kodi Community Forum

Full Version: Bug with multiple RSS feeds?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello,

I am using Dharma RC2, and trying to add a second RSS feed in order to display weather forecast. Unfortunately, no matter what configuration I use, all RSS feeds show exactly the same data.

Here is my RSSFeeds.xml
Code:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<rssfeeds>
  <!-- RSS feeds. To have multiple feeds, just add a feed to the set. You can also have multiple sets.     !-->
  <!-- To use different sets in your skin, each must be called from skin with a unique id.                 !-->
  <set id="1">
    <description>feedburner</description>
    <feed updateinterval="30">http://p.yimg.com/dj/rss/</feed>
  </set>
  <set id="2">
      <description>meteo</description>
    <feed updateinterval="30">rss://localhost/meteo/rss.php</feed>
  </set>
</rssfeeds>

If I look at the debug XBMC.log, I notice that only one URL is fetched :
Quote:21:25:57 T:2977418096 M:2692763648 DEBUG: FileCurl::Open(0xb177b118) http://p.yimg.com/dj/rss/
21:25:57 T:2977418096 M:2692763648 INFO: easy_aquire - Created session to http://p.yimg.com
21:25:58 T:2977418096 M:2690211840 DEBUG: FileCurl::Close(0xb177b118) http://p.yimg.com/dj/rss/
21:25:58 T:2977418096 M:2690211840 DEBUG: Got rss feed: http://p.yimg.com/dj/rss/
21:25:58 T:2977418096 M:2689957888 DEBUG: RSS feed encoding: UTF-8
21:25:58 T:2977418096 M:2689957888 ERROR: convert_checked failed from UTF-8 to UTF-8, errno=84
21:25:58 T:2977418096 M:2689957888 ERROR: convert_checked failed from UTF-8 to WCHAR_T, errno=84
21:25:58 T:2977418096 M:2689703936 DEBUG: Parsed rss feed: http://p.yimg.com/dj/rss/

There is no reference at all to the second feed in the log file. If I switch the set IDs, then the second feed is displayed twice on the screen, and only this one is referenced in the XBMC.log file.

I found this 2008 thread which seem to report the same problem.

Am I doing anything wrong or is this a bug?

Thank you.

V.
I think I should have posted this in XBMC Community Forum > Development > Skin Development, is there any way to move this one, please?

Thank you.

V.
Two work for me

Quote:<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<rssfeeds>
<!--RSS feeds. To have multiple feeds, just add a feed to the set. You can also have multiple sets.-->
<!--To use different sets in your skin, each must be called from skin with a unique id.-->
<set id="1">
<feed updateinterval="30">http://feeds.feedburner.com/mpiii/nfl</feed>
<feed updateinterval="30">http://www.movies.com/rss-feeds/top-ten-box-office-rss</feed>
</set>
</rssfeeds>
maybe it doesn't like your 2nd link?
Put your second URL just under the first one. It won't work in the 'set 2' unless the skin is written to support it, most don't.
mcborzu Wrote:Two work for me
maybe it doesn't like your 2nd link?
It seems that we are not doing the same thing : you have one RSS displayed on the screen (coming from two feeds). What I am trying to achieve is two independent RSS (i.e two different lines/sets with different content).

V.
stoli Wrote:Put your second URL just under the first one. It won't work in the 'set 2' unless the skin is written to support it, most don't.
I'm using my own skin actually...

In my Home.xml I have
Code:
            <control type="rss">
                <description>RSS feed</description>
                <posx>35</posx>
                <posy>6</posy>
                <height>35</height>
                <width>825</width>
                <font>font12</font>
                [color=Red]<urlset>1</urlset>[/color]
                <textcolor>blue</textcolor>
                <titlecolor>blue</titlecolor>
                <headlinecolor>white</headlinecolor>
                <visible>system.getbool(lookandfeel.enablerssfeeds)</visible>
            </control>

then a bit below

Code:
                <control type="rss">
                    <description>RSS feed meteo</description>
                    <posx>80</posx>
                    <posy>250</posy>
                    <height>40</height>
                    <width>340</width>
                    <font>font12</font>
                    [color=Red]<urlset>2</urlset>[/color]
                    <textcolor>blue</textcolor>
                    <titlecolor>blue</titlecolor>
                    <headlinecolor>white</headlinecolor>
                </control>

Both work (i.e display scrolling text), but they display the exact same content regardless of the <urlset> tag I specify...

V.
I did more investigation today, and this really looks like a bug. It would be useful if somebody can confirm it.

As reported previously, I noticed that only the first set of RSS URL appears in the xbmc.log.

So, I traced this debug statement to xbmc/util/RssReader.cpp, and using some debugger, noticed that very strangely, not matter how many URL sets I create, the CRssReader::Create method is only called once. I noticed that this method is called from CGUIRSSControl::Render(), and interestingly, the piece of code below that creates the different threads is only called once also :
Code:
// Create RSS background/worker thread if needed
    if (m_pReader == NULL)
    {
      CLog::Log(LOGNOTICE,"[CGUIRSSControl] this should never happen");
      if (g_rssManager.GetReader(GetID(), GetParentID(), this, m_pReader))
        m_scrollInfo.characterPos = m_pReader->m_SavedScrollPos;
      else
      {
        if (m_strRSSTags != "")
        {
          CStdStringArray vecSplitTags;

          StringUtils::SplitString(m_strRSSTags, ",", vecSplitTags);

          for (unsigned int i = 0;i < vecSplitTags.size();i++)
            m_pReader->AddTag(vecSplitTags[i]);
        }
        // use half the width of the control as spacing between feeds, and double this between feed sets
        float spaceWidth = (m_label.font) ? m_label.font->GetCharWidth(L' ') : 15;
        m_pReader->Create(this, m_vecUrls, m_vecIntervals, (int)(0.5f*GetWidth() / spaceWidth) + 1, m_rtl);
      }
    }
I would expect that one thread is actually initialized for each urlset (each having heir own m_pReader), but in my case this does not happen.

Note that in CGUIControlFactory::Create, the below piece of code does sucessfully initialize all CGUIRSSControls and for each of them calls SetUrls with the right values. If seems that the problem occurs further in the workflow.
Code:
control = new CGUIRSSControl(
      parentID, id, posX, posY, width, height,
      labelInfo, textColor3, headlineColor, strRSSTags);

    std::map<int,CSettings::RssSet>::iterator iter=g_settings.m_mapRssUrls.find(iUrlSet);
    if (iter != g_settings.m_mapRssUrls.end())
    {
      ((CGUIRSSControl *)control)->SetUrls(iter->second.url,iter->second.rtl);
      ((CGUIRSSControl *)control)->SetIntervals(iter->second.interval);
    }

In the end, I suspect that the issue comes from the rendering engine that just bypasses the urlset property and calls Render() on the same instance (hence all urlsets show the same data). Unfortunately, I know too little on the xbmc internals to confirm this.

Thank you in advance for any help.

V.
Bumping to request an admin to move this tread to XBMC Community Forum > Development > Skin Development, as I believe it is currently not in the right forum.

Thank you.

V.
try adding:

<control type="rss" id="1">

and then for the second one:

<control type="rss" id="2">
stoli Wrote:try adding:
<control type="rss" id="1">
and then for the second one:
<control type="rss" id="2">
Thank you, Stoli! Indeed that worked. Thank you very much.

I'm puzzled because the RSS_feed_Control page on the Wiki uses examples with the <urlset> parameter.

I grepped the source and there is no trace of urlset anywhere (except in some skin files), so I am now assuming this is obsolete and replaced by the "id" attribute that you provided.

Do you think it makes sense I correct this in the Wiki?

V.
Yea usually besides real life, and whatever XBMC related tasks someones has, finding time to update the wiki always gets pushed to the side. Yea if you find something incorrect, change it...
I corrected RSS_feed_Control. Happy to contribnute to the community!

V.