Opened 13 years ago

Closed 13 years ago

#3362 closed patch (invalid)

Mythmusic queries failing using smartlist

Reported by: anonymous Owned by: Isaac Richards
Priority: minor Milestone: unknown
Component: mythmusic Version: head
Severity: medium Keywords: SQL queries
Cc: Ticket locked: no

Description

hey,

I installed mythmusic plug-in and had some problems, I couldn't use the smart list because the SQL queries were returning errors... I produced some patches from the changes I made.

Rudy Attias

P.S

I use slackware 11.0 and I have installed mythtv-0.20/mythplugins-0.20a. folows are the patches:

--- mythplugins-0.20a/mythmusic/mythmusic/metadata.cpp 2006-08-29 23:13:35.000000000 +0300 +++ mythplugins-0.20a_patched/mythmusic/mythmusic/metadata.cpp 2007-03-12 00:03:52.000000000 +0200 @@ -190,7 +190,7 @@

Load the artist id or insert it and get the id unsigned int artistId; query.prepare("SELECT artist_id FROM music_artists "

  • "WHERE artist_name = :ARTIST ;");

+ "WHERE music_artists.artist_name = :ARTIST ;");

query.bindValue(":ARTIST", artist.utf8());

if (!query.exec()
!query.isActive())

@@ -219,7 +219,7 @@

Compilation Artist unsigned int compilationArtistId; query.prepare("SELECT artist_id FROM music_artists "

  • "WHERE artist_name = :ARTIST ;");

+ "WHERE music_artists.artist_name = :ARTIST ;");

query.bindValue(":ARTIST", compilation_artist.utf8());

if (!query.exec()
!query.isActive())

{

--- mythplugins-0.20a/mythmusic/mythmusic/playbackbox.cpp 2006-09-05 06:36:34.000000000 +0300 +++ mythplugins-0.20a_patched/mythmusic/mythmusic/playbackbox.cpp 2007-03-12 00:25:37.000000000 +0200 @@ -549,7 +549,7 @@

return;

closePlaylistPopup();

  • updatePlaylistFromQuickPlaylist("ORDER BY artist_name, album_name, track");

+ updatePlaylistFromQuickPlaylist("ORDER BY music_artists.artist_name, album_name, track");

}

void PlaybackBoxMusic::fromCD()

@@ -605,7 +605,7 @@

return;

QString value = formattedFieldValue(curMeta->Artist().utf8());

  • QString whereClause = "WHERE artist_name = " + value +

+ QString whereClause = "WHERE music_artists.artist_name = " + value +

" ORDER BY album_name, track";

closePlaylistPopup();

@@ -631,7 +631,7 @@

QString value = formattedFieldValue(curMeta->Genre().utf8()); QString whereClause = "WHERE genre = " + value +

  • " ORDER BY artist_name, album_name, track";

+ " ORDER BY music_artists.artist_name, album_name, track";

closePlaylistPopup(); updatePlaylistFromQuickPlaylist(whereClause);

}

@@ -642,8 +642,8 @@

return;

QString value = formattedFieldValue(curMeta->Year());

  • QString whereClause = "WHERE year = " + value +
  • " ORDER BY artist_name, album_name, track";

+ QString whereClause = "WHERE music_songs.year = " + value + + " ORDER BY music_artists.artist_name, album_name, track";

closePlaylistPopup(); updatePlaylistFromQuickPlaylist(whereClause);

}

--- mythplugins-0.20a/mythmusic/mythmusic/search.cpp 2006-08-31 17:36:17.000000000 +0300 +++ mythplugins-0.20a_patched/mythmusic/mythmusic/search.cpp 2007-03-12 00:06:57.000000000 +0200 @@ -103,7 +103,7 @@

MSqlQuery query(MSqlQuery::InitCon?());

  • QString queryString("SELECT filename, artist_name, album_name,

name, song_id " + QString queryString("SELECT filename, music_artists.artist_name, album_name, name, song_id "

"FROM music_songs " "LEFT JOIN music_artists ON

music_songs.artist_id=music_artists.artist_id "

"LEFT JOIN music_albums ON

music_songs.album_id=music_albums.album_id "); @@ -143,7 +143,7 @@

}

queryString += whereClause;

  • queryString += " ORDER BY artist_name, album_name, name, song_id,

filename "; + queryString += " ORDER BY music_artists.artist_name, album_name, name, song_id, filename ";

query.prepare(queryString);

Change History (1)

comment:1 Changed 13 years ago by stuartm

Resolution: invalid
Status: newclosed
Summary: Mythmusic queries failing using smartlist

Half of the queries you've fixed shouldn't need fixing, so it's not immediately clear which of them is failing for you.

However I'm pretty your problem is already fixed in SVN (fixes and head). I'd suggest upgrading to either version. 0.20.1 will be released very soon if you prefer tar.gz over using subversion.

Note: See TracTickets for help on using tickets.