Error in Smart Playlist

  Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
myyra Offline
Junior Member
Posts: 10
Joined: Jan 2010
Reputation: 0
Post: #1
Hi,

I just ran into the following error when creating smart playlists:

When creating a smart playlist where you want to use 'genre' when filtering tv shows, xbmc creates an invalid sql query. SQLite gives 'Error 1 - ambiguous column name: idshow'

This only happens when using tv shows, movies and episodes work ok.

XBMC r28275, Ubuntu 9.10

Here's the smartplaylist:
Code:
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<smartplaylist type="tvshows">
    <name>Documentary series</name>
    <match>all</match>
    <rule field="genre" operator="contains">Documentary</rule>
    <limit>1000</limit>
</smartplaylist>

And here's pastebin: http://pastebin.com/Kb5i6Lb9

I also tried the r28718 just to see if it's been fixed on newer SVN'n, and i encountered additional bug. This version also creates bogus sql, but this time it also messed up the LIKE '%%' command. If you have 'd' as first character, it becomes %d and that translates to some "random" decimal.
Code:
.. genre.strGenre LIKE '-1337005668ocumentary%'))

And here's pastebin: http://pastebin.com/ZdCupqxT
find quote
myyra Offline
Junior Member
Posts: 10
Joined: Jan 2010
Reputation: 0
Post: #2
Replying to myself:

Since problem was ambiguous column name: idshow, I slightly changed SQL-statements from

Code:
... WHERE (idshow in (select idshow from genrelinktvshow ...

to

Code:
... WHERE (tvshow.idshow in (select idshow from genrelinktvshow ...

in file SmartPlaylist.cpp located in xbmc/ folder, starting from line 517.

Not sure if this is the correct way to fix this, but it seems to work.
find quote
spiff Offline
Grumpy Bastard Developer
Posts: 12,179
Joined: Nov 2003
Reputation: 82
Post: #3
looks correct to me. patch -> trac please.

Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.
find quote
jmarshall Offline
Team-XBMC Developer
Posts: 24,523
Joined: Oct 2003
Reputation: 138
Post: #4
The second problem looks like it's being passed through FormatSQL when it shouldn't be?

Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


[Image: badge.gif]
find quote