Ticket #3104: add_artist_sortkey.patch
File add_artist_sortkey.patch, 29.3 KB (added by , 17 years ago) |
---|
-
mythmusic/mythmusic/music-ui.xml
466 466 <value>Artist:</value> 467 467 </textarea> 468 468 469 <textarea name=" album_label" draworder="1" align="right">469 <textarea name="sort_artist_label" draworder="1" align="right"> 470 470 <area>15,190,170,30</area> 471 471 <font>labels</font> 472 <value>Sort Artist:</value> 473 </textarea> 474 475 <textarea name="album_label" draworder="1" align="right"> 476 <area>15,230,170,30</area> 477 <font>labels</font> 472 478 <value>Album:</value> 473 479 </textarea> 474 480 475 481 <textarea name="title_text" draworder="1" align="right"> 476 <area>15,2 30,170,30</area>482 <area>15,270,170,30</area> 477 483 <font>labels</font> 478 484 <value>Title:</value> 479 485 </textarea> 480 486 481 487 <textarea name="genre_label" draworder="1" align="right"> 482 <area>15, 270,170,30</area>488 <area>15,310,170,30</area> 483 489 <font>labels</font> 484 490 <value>Genre:</value> 485 491 </textarea> 486 492 487 493 <textarea name="year_label" draworder="1" align="right"> 488 <area>15,3 10,170,30</area>494 <area>15,350,170,30</area> 489 495 <font>labels</font> 490 496 <value>Year:</value> 491 497 </textarea> 492 498 493 499 <textarea name="track_label" draworder="1" align="right"> 494 <area>365,3 10,170,30</area>500 <area>365,350,170,30</area> 495 501 <font>labels</font> 496 502 <value>Track No.:</value> 497 503 </textarea> 498 504 499 505 <textarea name="rating_label" draworder="1" align="right"> 500 <area>15,3 50,170,30</area>506 <area>15,390,170,30</area> 501 507 <font>labels</font> 502 508 <value>Rating:</value> 503 509 </textarea> 504 510 505 511 <textarea name="playcount_label" draworder="1" align="right"> 506 <area>420, 390,300,30</area>512 <area>420,430,300,30</area> 507 513 <font>labels</font> 508 514 <value>Play Count:</value> 509 515 </textarea> 510 516 511 517 <textarea name="lastplay_label" draworder="1" align="right"> 512 <area>15, 390,170,30</area>518 <area>15,430,170,30</area> 513 519 <font>labels</font> 514 520 <value>Last Play:</value> 515 521 </textarea> 516 522 517 523 <textarea name="filename_label" draworder="1" align="right"> 518 <area>15,4 30,170,30</area>524 <area>15,470,170,30</area> 519 525 <font>labels</font> 520 526 <value>Filename:</value> 521 527 </textarea> … … 557 563 <image function="pushed" filename="mm_blankbutton_pushed.png"></image> 558 564 </pushbutton> 559 565 566 <remoteedit name="searchartist_edit" draworder="1" align="left"> 567 <area>195,190,525,35</area> 568 <font>display</font> 569 </remoteedit> 560 570 561 571 <remoteedit name="album_edit" draworder="1" align="left"> 562 <area>195, 190,525,35</area>572 <area>195,230,525,35</area> 563 573 <font>display</font> 564 574 </remoteedit> 565 575 566 576 <pushbutton name="searchalbum_button" draworder="2"> 567 <position>725, 190</position>577 <position>725,230</position> 568 578 <image function="on" filename="mm_blankbutton_on.png"></image> 569 579 <image function="off" filename="mm_blankbutton_off.png"></image> 570 580 <image function="pushed" filename="mm_blankbutton_pushed.png"></image> 571 581 </pushbutton> 572 582 573 583 <remoteedit name="title_edit" draworder="1" align="left"> 574 <area>195,2 30,525,35</area>584 <area>195,270,525,35</area> 575 585 <font>display</font> 576 586 </remoteedit> 577 587 578 588 <remoteedit name="genre_edit" draworder="1" align="left"> 579 <area>195, 270,525,35</area>589 <area>195,310,525,35</area> 580 590 <font>display</font> 581 591 </remoteedit> 582 592 583 593 <pushbutton name="searchgenre_button" draworder="2"> 584 <position>725, 270</position>594 <position>725,310</position> 585 595 <image function="on" filename="mm_blankbutton_on.png"></image> 586 596 <image function="off" filename="mm_blankbutton_off.png"></image> 587 597 <image function="pushed" filename="mm_blankbutton_pushed.png"></image> 588 598 </pushbutton> 589 599 590 600 <remoteedit name="year_edit" draworder="1" align="left"> 591 <area>195,3 10,175,35</area>601 <area>195,350,175,35</area> 592 602 <font>display</font> 593 603 </remoteedit> 594 604 595 605 <remoteedit name="track_edit" draworder="1" align="left"> 596 <area>545,3 10,175,35</area>606 <area>545,350,175,35</area> 597 607 <font>display</font> 598 608 </remoteedit> 599 609 600 610 <repeatedimage name="rating_image" draworder="1" fleximage="no"> 601 611 <filename>mm_rating.png</filename> 602 <position>190, 360</position>612 <position>190,400</position> 603 613 <orientation>LeftToRight</orientation> 604 614 </repeatedimage> 605 615 606 616 <selector name="rating_button" draworder="0"> 607 <area>420,3 50,30,30</area>617 <area>420,390,30,30</area> 608 618 <font>display</font> 609 619 <image function="on" filename="mm_leftright_on.png"></image> 610 620 <image function="off" filename="mm_leftright_off.png"></image> … … 612 622 </selector> 613 623 614 624 <textarea name="playcount_text" draworder="1" align="left"> 615 <area>725, 390,400,30</area>625 <area>725,430,400,30</area> 616 626 <font>display</font> 617 627 </textarea> 618 628 619 629 <textarea name="lastplay_text" draworder="1" align="left"> 620 <area>195, 390,400,30</area>630 <area>195,430,400,30</area> 621 631 <font>display</font> 622 632 </textarea> 623 633 624 634 <textarea name="filename_text" draworder="1" align="left"> 625 <area>195,4 30,550,100</area>635 <area>195,470,550,100</area> 626 636 <multiline>yes</multiline> 627 637 <font>display</font> 628 638 </textarea> … … 632 642 --> 633 643 634 644 <textbutton name="done_button" draworder="0"> 635 <position>350,5 40</position>645 <position>350,550</position> 636 646 <font>display</font> 637 647 <image function="on" filename="text_button_on.png"></image> 638 648 <image function="off" filename="text_button_off.png"></image> -
mythmusic/mythmusic/metaioflacvorbiscomment.cpp
134 134 */ 135 135 Metadata* MetaIOFLACVorbisComment::read(QString filename) 136 136 { 137 QString artist = "", compilation_artist = "", album = "", title = "", genre = "";137 QString artist = "", search_artist = "", compilation_artist = "", album = "", title = "", genre = ""; 138 138 int year = 0, tracknum = 0, length = 0; 139 139 bool compilation = false; 140 140 … … 184 184 else 185 185 { 186 186 artist = getComment(block, MYTH_VORBISCOMMENT_ARTIST); 187 search_artist = getComment(block, MYTH_VORBISCOMMENT_ARTIST); 187 188 compilation_artist = getComment(block, 188 189 MYTH_VORBISCOMMENT_COMPILATIONARTIST); 189 190 album = getComment(block, MYTH_VORBISCOMMENT_ALBUM); … … 200 201 FLAC__metadata_chain_delete(chain); 201 202 FLAC__metadata_iterator_delete(iterator); 202 203 203 Metadata *retdata = new Metadata(filename, artist, compilation_artist, album,204 title, genre, year, tracknum, length);204 Metadata *retdata = new Metadata(filename, artist, search_artist, compilation_artist, 205 album, title, genre, year, tracknum, length); 205 206 206 207 retdata->setCompilation(compilation); 207 208 -
mythmusic/mythmusic/metadata.cpp
32 32 Metadata& Metadata::operator=(Metadata *rhs) 33 33 { 34 34 m_artist = rhs->m_artist; 35 m_searchartist = rhs->m_searchartist; 35 36 m_compilation_artist = rhs->m_compilation_artist; 36 37 m_album = rhs->m_album; 37 38 m_title = rhs->m_title; … … 105 106 106 107 MSqlQuery query(MSqlQuery::InitCon()); 107 108 query.prepare("SELECT music_artists.artist_name, " 109 "music_artists.artist_sortkey, " 108 110 "music_comp_artists.artist_name AS compilation_artist, " 109 111 "music_albums.album_name, music_songs.name, music_genres.genre, " 110 112 "music_songs.year, music_songs.track, music_songs.length, " … … 128 130 query.next(); 129 131 130 132 m_artist = QString::fromUtf8(query.value(0).toString()); 131 m_compilation_artist = QString::fromUtf8(query.value(1).toString()); 132 m_album = QString::fromUtf8(query.value(2).toString()); 133 m_title = QString::fromUtf8(query.value(3).toString()); 134 m_genre = QString::fromUtf8(query.value(4).toString()); 135 m_year = query.value(5).toInt(); 136 m_tracknum = query.value(6).toInt(); 137 m_length = query.value(7).toInt(); 138 m_id = query.value(8).toUInt(); 139 m_rating = query.value(9).toInt(); 140 m_playcount = query.value(10).toInt(); 141 m_lastplay = query.value(11).toString(); 142 m_compilation = (query.value(12).toInt() > 0); 143 m_format = query.value(13).toString(); 133 m_searchartist = QString::fromUtf8(query.value(1).toString()); 134 m_compilation_artist = QString::fromUtf8(query.value(2).toString()); 135 m_album = QString::fromUtf8(query.value(3).toString()); 136 m_title = QString::fromUtf8(query.value(4).toString()); 137 m_genre = QString::fromUtf8(query.value(5).toString()); 138 m_year = query.value(6).toInt(); 139 m_tracknum = query.value(7).toInt(); 140 m_length = query.value(8).toInt(); 141 m_id = query.value(9).toUInt(); 142 m_rating = query.value(10).toInt(); 143 m_playcount = query.value(11).toInt(); 144 m_lastplay = query.value(12).toString(); 145 m_compilation = (query.value(13).toInt() > 0); 146 m_format = query.value(14).toString(); 144 147 145 148 retval = true; 146 149 } … … 160 163 161 164 if (m_artist == "") 162 165 m_artist = QObject::tr("Unknown Artist"); 166 if (m_searchartist == "") 167 m_searchartist = m_artist; // same as artist, if not specified 163 168 if (m_compilation_artist == "") 164 169 m_compilation_artist = m_artist; // This should be the same as Artist if blank. 165 170 if (m_album == "") … … 179 184 "LEFT JOIN music_artists AS music_comp_artists ON music_albums.artist_id=music_comp_artists.artist_id " 180 185 "LEFT JOIN music_genres ON music_songs.genre_id=music_genres.genre_id " 181 186 "WHERE music_artists.artist_name = :ARTIST" 187 " AND music_artists.artist_sortkey = :SORTARTIST" 182 188 " AND music_comp_artists.artist_name = :COMPILATION_ARTIST" 183 189 " AND music_albums.album_name = :ALBUM" 184 190 " AND music_songs.name = :TITLE" … … 189 195 " AND music_songs.format = :FORMAT ;"); 190 196 191 197 query.bindValue(":ARTIST", m_artist.utf8()); 198 query.bindValue(":SORTARTIST", m_searchartist.utf8()); 192 199 query.bindValue(":COMPILATION_ARTIST", m_compilation_artist.utf8()); 193 200 query.bindValue(":ALBUM", m_album.utf8()); 194 201 query.bindValue(":TITLE", m_title.utf8()); … … 244 251 } 245 252 246 253 // Load the artist id or insert it and get the id 254 // if artist id found, update artist_sortkey 247 255 unsigned int artistId; 248 256 query.prepare("SELECT artist_id FROM music_artists " 249 257 "WHERE artist_name = :ARTIST ;"); … … 257 265 if (query.next()) 258 266 { 259 267 artistId = query.value(0).toInt(); 268 269 query.prepare("UPDATE music_artists SET artist_sortkey = :SORTARTIST " 270 "WHERE artist_id = :ARTISTID ;"); 271 query.bindValue(":SORTARTIST", m_searchartist.utf8()); 272 query.bindValue(":ARTISTID", artistId); 273 if (!query.exec() || !query.isActive() || query.numRowsAffected() <= 0) 274 { 275 MythContext::DBError("music update sortartist", query); 276 return; 277 } 260 278 } 261 279 else 262 280 { 263 query.prepare("INSERT INTO music_artists (artist_name) VALUES (:ARTIST);"); 281 query.prepare("INSERT INTO music_artists (artist_name,artist_sortkey) " 282 "VALUES (:ARTIST, :SORTARTIST);"); 264 283 query.bindValue(":ARTIST", m_artist.utf8()); 284 query.bindValue(":SORTARTIST", m_searchartist.utf8()); 265 285 266 286 if (!query.exec() || !query.isActive() || query.numRowsAffected() <= 0) 267 287 { … … 269 289 return; 270 290 } 271 291 artistId = query.lastInsertId().toInt(); 292 272 293 } 273 294 274 295 // Compilation Artist … … 443 464 QString Metadata::m_formatnormalfiletrack = "TITLE"; 444 465 QString Metadata::m_formatnormalcdartist = "ARTIST"; 445 466 QString Metadata::m_formatnormalcdtrack = "TITLE"; 467 QString Metadata::m_formatnormalsortartist = "ARTIST"; 446 468 QString Metadata::m_formatcompilationfileartist = "COMPARTIST"; 447 469 QString Metadata::m_formatcompilationfiletrack = "TITLE (ARTIST)"; 448 470 QString Metadata::m_formatcompilationcdartist = "COMPARTIST"; … … 467 489 tmp = gContext->GetSetting("MusicFormatNormalCDTrack"); 468 490 if (!tmp.isEmpty()) 469 491 m_formatnormalcdtrack = tmp; 492 493 tmp = gContext->GetSetting("MusicFormatNormalSortArtist"); 494 if (!tmp.isEmpty()) 495 m_formatnormalsortartist = tmp; 470 496 471 497 tmp = gContext->GetSetting("MusicFormatCompilationFileArtist"); 472 498 if (!tmp.isEmpty()) … … 500 526 QString rv = format; 501 527 rv.replace("COMPARTIST", m_compilation_artist); 502 528 rv.replace("ARTIST", m_artist); 529 rv.replace("SORTARTIST", m_searchartist); 503 530 rv.replace("TITLE", m_title); 504 531 rv.replace("TRACK", QString("%1").arg(m_tracknum, 2)); 505 532 return rv; … … 573 600 // completeness. 574 601 else if (field == "compilation_artist") 575 602 m_compilation_artist = data; 603 // turbo@talstar.com: Likewise, I've added searchartist stuff here for 604 // completeness. 605 else if (field == "searchartist") 606 m_searchartist = data; 576 607 else if (field == "album") 577 608 m_album = data; 578 609 else if (field == "title") … … 662 693 MSqlQuery query(MSqlQuery::InitCon()); 663 694 if ("artist" == field) 664 695 { 665 query.prepare("SELECT artist_name FROM music_artists ORDER BY artist_ name;");696 query.prepare("SELECT artist_name FROM music_artists ORDER BY artist_sortkey;"); 666 697 } 667 698 else if ("compilation_artist" == field) 668 699 { 669 700 query.prepare("SELECT DISTINCT artist_name FROM music_artists, music_albums where " 670 "music_albums.artist_id=music_artists.artist_id ORDER BY artist_ name");701 "music_albums.artist_id=music_artists.artist_id ORDER BY artist_sortkey"); 671 702 } 672 703 else if ("album" == field) 673 704 { … … 792 823 { 793 824 m_done_loading = false; 794 825 795 QString aquery = "SELECT music_songs.song_id, music_artists.artist_name, music_ comp_artists.artist_name AS compilation_artist, "826 QString aquery = "SELECT music_songs.song_id, music_artists.artist_name, music_artists.artist_sortkey, music_comp_artists.artist_name AS compilation_artist, " 796 827 "music_albums.album_name, music_songs.name, music_genres.genre, music_songs.year, " 797 828 "music_songs.track, music_songs.length, CONCAT(music_directories.path, '/', music_songs.filename) AS filename, " 798 829 "music_songs.rating, music_songs.numplays, music_songs.lastplay, music_albums.compilation, " … … 805 836 "LEFT JOIN music_genres ON music_songs.genre_id=music_genres.genre_id " 806 837 "ORDER BY music_songs.song_id;"; 807 838 808 QString filename, artist, album, title;839 QString filename, artist, searchartist, album, title; 809 840 810 841 MSqlQuery query(MSqlQuery::InitCon()); 811 842 query.exec(aquery); … … 820 851 { 821 852 while (query.next()) 822 853 { 823 filename = QString::fromUtf8(query.value( 9).toString());854 filename = QString::fromUtf8(query.value(10).toString()); 824 855 if (!filename.contains("://")) 825 856 filename = m_startdir + filename; 826 857 … … 828 859 if (artist.isEmpty()) 829 860 artist = QObject::tr("Unknown Artist"); 830 861 831 album = QString::fromUtf8(query.value(3).toString()); 862 searchartist = QString::fromUtf8(query.value(2).toString()); 863 if (searchartist.isEmpty()) 864 searchartist = artist; 865 866 album = QString::fromUtf8(query.value(4).toString()); 832 867 if (album.isEmpty()) 833 868 album = QObject::tr("Unknown Album"); 834 869 835 title = QString::fromUtf8(query.value( 4).toString());870 title = QString::fromUtf8(query.value(5).toString()); 836 871 if (title.isEmpty()) 837 872 title = QObject::tr("Unknown Title"); 838 873 839 874 Metadata *temp = new Metadata( 840 875 filename, 841 876 artist, 842 QString::fromUtf8(query.value(2).toString()), 877 searchartist, 878 QString::fromUtf8(query.value(3).toString()), 843 879 album, 844 880 title, 845 QString::fromUtf8(query.value(5).toString()), 846 query.value(6).toInt(), 881 QString::fromUtf8(query.value(6).toString()), 847 882 query.value(7).toInt(), 848 883 query.value(8).toInt(), 884 query.value(9).toInt(), 849 885 query.value(0).toInt(), 850 query.value(1 0).toInt(), //rating851 query.value(1 1).toInt(), //playcount852 query.value(1 2).toString(), //lastplay853 (query.value(1 3).toInt() > 0), //compilation854 query.value(1 4).toString()); //format886 query.value(11).toInt(), //rating 887 query.value(12).toInt(), //playcount 888 query.value(13).toString(), //lastplay 889 (query.value(14).toInt() > 0), //compilation 890 query.value(15).toString()); //format 855 891 856 892 // Don't delete temp, as PtrList now owns it 857 893 m_all_music.append(temp); -
mythmusic/mythmusic/dbcheck.cpp
9 9 #include "mythtv/mythcontext.h" 10 10 #include "mythtv/mythdbcon.h" 11 11 12 const QString currentDatabaseVersion = "100 8";12 const QString currentDatabaseVersion = "1009"; 13 13 14 14 static bool UpdateDBVersionNumber(const QString &newnumber) 15 15 { … … 497 497 return false; 498 498 } 499 499 500 if (dbver == "1008") 501 { 502 const QString updates[] = { 503 "ALTER TABLE music_artists ADD COLUMN artist_sortkey varchar(255) NOT NULL DEFAULT '';", 504 "UPDATE music_artists SET artist_sortkey = artist_name;", 505 "ALTER TABLE music_artists ADD INDEX (artist_sortkey);", 506 "" 507 }; 508 509 if (!performActualUpdate(updates, "1009", dbver)) 510 return false; 511 } 512 513 500 514 /* in 0.21 */ 501 515 //"DROP TABLE musicmetadata;", 502 516 //"DROP TABLE musicplaylist;", -
mythmusic/mythmusic/metadata.h
15 15 class Metadata 16 16 { 17 17 public: 18 Metadata(QString lfilename = "", QString lartist = "", QString lcompilation_artist = "", 18 Metadata(QString lfilename = "", QString lartist = "", QString lsearchartist = "", 19 QString lcompilation_artist = "", 19 20 QString lalbum = "", QString ltitle = "", QString lgenre = "", 20 21 int lyear = 0, int ltracknum = 0, int llength = 0, int lid = 0, 21 22 int lrating = 0, int lplaycount = 0, QString llastplay = "", … … 23 24 { 24 25 m_filename = lfilename; 25 26 m_artist = lartist; 27 m_searchartist = lsearchartist; 26 28 m_compilation_artist = lcompilation_artist; 27 29 m_album = lalbum; 28 30 m_title = ltitle; … … 73 75 74 76 QString Artist() { return m_artist; } 75 77 void setArtist(const QString &lartist) { m_artist = lartist; m_formattedartist = m_formattedtitle = ""; } 78 79 QString SearchArtist() { return m_searchartist; } 80 void setSearchArtist(const QString &lsearchartist) { m_searchartist = lsearchartist; m_formattedartist = m_formattedtitle = ""; } 76 81 77 82 QString CompilationArtist() { return m_compilation_artist; } 78 83 void setCompilationArtist(const QString &lcompilation_artist) { m_compilation_artist = lcompilation_artist; m_formattedartist = m_formattedtitle = ""; } … … 148 153 QString formatReplaceSymbols(const QString &format); 149 154 150 155 QString m_artist; 156 QString m_searchartist; 151 157 QString m_compilation_artist; 152 158 QString m_album; 153 159 QString m_title; … … 177 183 static QString m_formatnormalcdartist; 178 184 static QString m_formatnormalcdtrack; 179 185 186 static QString m_formatnormalsortartist; 187 180 188 static QString m_formatcompilationfileartist; 181 189 static QString m_formatcompilationfiletrack; 182 190 static QString m_formatcompilationcdartist; -
mythmusic/mythmusic/editmetadata.cpp
34 34 artist_edit->setText(m_metadata->Artist()); 35 35 } 36 36 37 if (searchartist_edit) 38 { 39 searchartist_edit->setText(m_metadata->SearchArtist()); 40 } 41 37 42 if (compilation_artist_edit) 38 43 { 39 44 compilation_artist_edit->setText(m_metadata->CompilationArtist()); … … 185 190 artist_edit->createEdit(this); 186 191 connect(artist_edit, SIGNAL(loosingFocus()), this, SLOT(editLostFocus())); 187 192 } 193 194 searchartist_edit = getUIRemoteEditType("searchartist_edit"); 195 if (searchartist_edit) 196 { 197 searchartist_edit->createEdit(this); 198 connect(searchartist_edit, SIGNAL(loosingFocus()), this, SLOT(editLostFocus())); 199 } 188 200 189 201 compilation_artist_edit = getUIRemoteEditType("compilation_artist_edit"); 190 202 if (compilation_artist_edit) … … 297 309 { 298 310 m_metadata->setArtist(artist_edit->getText()); 299 311 } 312 else if (whichEditor == searchartist_edit) 313 { 314 m_metadata->setSearchArtist(searchartist_edit->getText()); 315 } 300 316 else if (whichEditor == compilation_artist_edit) 301 317 { 302 318 m_metadata->setCompilationArtist(compilation_artist_edit->getText()); -
mythmusic/mythmusic/metaioavfcomment.cpp
51 51 */ 52 52 Metadata* MetaIOAVFComment::read(QString filename) 53 53 { 54 QString artist = "", compilation_artist = "", album = "", title = "", genre = "";54 QString artist = "", search_artist = "", compilation_artist = "", album = "", title = "", genre = ""; 55 55 int year = 0, tracknum = 0, length = 0; 56 56 57 57 AVFormatContext* p_context = NULL; … … 76 76 else 77 77 { 78 78 artist += (char *)p_context->author; 79 search_artist += (char *)p_context->author; 79 80 // compilation_artist??? 80 81 album += (char *)p_context->album; 81 82 genre += (char *)p_context->genre; … … 85 86 86 87 length = getTrackLength(p_context); 87 88 88 Metadata *retdata = new Metadata(filename, artist, compilation_artist, album,89 title, genre, year, tracknum, length);89 Metadata *retdata = new Metadata(filename, artist, search_artist, compilation_artist, 90 album, title, genre, year, tracknum, length); 90 91 91 92 retdata->determineIfCompilation(); 92 93 -
mythmusic/mythmusic/editmetadata.h
58 58 // 59 59 60 60 UIRemoteEditType *artist_edit; 61 UIRemoteEditType *searchartist_edit; 61 62 UIRemoteEditType *compilation_artist_edit; 62 63 UIRemoteEditType *album_edit; 63 64 UIRemoteEditType *title_edit; -
mythmusic/mythmusic/cddecoder.cpp
334 334 Metadata *CdDecoder::getMetadata() 335 335 { 336 336 337 QString artist = "", album = "", compilation_artist = "", title = "", genre = "";337 QString artist = "", search_artist = "", album = "", compilation_artist = "", title = "", genre = ""; 338 338 int year = 0, tracknum = 0, length = 0; 339 339 340 340 int cd = cd_init_device((char *)devicename.ascii()); … … 428 428 length = length < 0 ? 0 : length; 429 429 length *= 1000; 430 430 431 Metadata *retdata = new Metadata(filename, artist, compilation_artist,431 Metadata *retdata = new Metadata(filename, artist, search_artist, compilation_artist, 432 432 album, title, genre, year, tracknum, length); 433 433 434 434 retdata->determineIfCompilation(true); … … 486 486 if (mdata->Artist() != discdata.data_artist) 487 487 strncpy(discdata.data_artist, mdata->Artist().utf8(), 256); 488 488 } 489 490 if (mdata->SearchArtist() != discdata.data_artist) 491 strncpy(discdata.data_artist, mdata->SearchArtist().utf8(), 256); 492 489 493 if (mdata->Album() != discdata.data_title) 490 494 strncpy(discdata.data_title, mdata->Album().utf8(), 256); 491 495 if (mdata->Title() != discdata.data_track[tracknum - 1].track_name) -
mythmusic/mythmusic/metaiooggvorbiscomment.cpp
275 275 */ 276 276 Metadata* MetaIOOggVorbisComment::read(QString filename) 277 277 { 278 QString artist = "", compilation_artist = "", album = "", title = "", genre = "";278 QString artist = "", search_artist = "", compilation_artist = "", album = "", title = "", genre = ""; 279 279 int year = 0, tracknum = 0, length = 0; 280 280 bool compilation = false; 281 281 … … 302 302 // 303 303 304 304 artist = getComment(comment, MYTH_VORBISCOMMENT_ARTIST); 305 search_artist = getComment(comment, MYTH_VORBISCOMMENT_ARTIST); 305 306 compilation_artist = getComment(comment, MYTH_VORBISCOMMENT_COMPILATIONARTIST); 306 307 album = getComment(comment, MYTH_VORBISCOMMENT_ALBUM); 307 308 title = getComment(comment, MYTH_VORBISCOMMENT_TITLE); … … 330 331 readFromFilename(filename, artist, album, title, genre, tracknum); 331 332 } 332 333 333 Metadata *retdata = new Metadata(filename, artist, compilation_artist, album,334 title, genre, year, tracknum, length);334 Metadata *retdata = new Metadata(filename, artist, search_artist, compilation_artist, 335 album, title, genre, year, tracknum, length); 335 336 336 337 retdata->setCompilation(compilation); 337 338 -
mythmusic/mythmusic/metaioid3v2.cpp
172 172 */ 173 173 Metadata* MetaIOID3v2::read(QString filename) 174 174 { 175 QString artist = "", compilation_artist = "", album = "", title = "",176 genre = "";175 QString artist = "", search_artist = "", compilation_artist = "", album = "", 176 title = "", genre = ""; 177 177 int year = 0, tracknum = 0, length = 0; 178 178 bool compilation = false; 179 179 id3_file *p_input = NULL; … … 194 194 195 195 title = getComment(tag, ID3_FRAME_TITLE); 196 196 artist = getComment(tag, ID3_FRAME_ARTIST); 197 search_artist = getComment(tag, ID3_FRAME_ARTIST); 197 198 compilation_artist = getComment(tag, MYTH_ID3_FRAME_COMPILATIONARTIST); 198 199 album = getComment(tag, ID3_FRAME_ALBUM); 199 200 compilation = (MYTH_MUSICBRAINZ_ALBUMARTIST_UUID … … 260 261 return NULL; 261 262 } 262 263 263 Metadata *retdata = new Metadata(filename, artist, compilation_artist, album,264 title, genre, year, tracknum, length);264 Metadata *retdata = new Metadata(filename, artist, search_artist, compilation_artist, 265 album, title, genre, year, tracknum, length); 265 266 266 267 retdata->setCompilation(compilation); 267 268