Fix crash when loading CD playlists
This commit is contained in:
@@ -530,14 +530,12 @@ void Song::InitFromQuery(const SqlRow &q, bool reliable_metadata, int col) {
|
||||
//qLog(Debug) << __PRETTY_FUNCTION__;
|
||||
//qLog(Debug) << "Song::kColumns.size():" << Song::kColumns.size() << "q.columns_.size():" << q.columns_.size() << "col:" << col;
|
||||
|
||||
int i = 0;
|
||||
int x = col;
|
||||
|
||||
d->id_ = toint(col);
|
||||
|
||||
for (i = 0 ; i < Song::kColumns.size(); i++) {
|
||||
x=i+col+1;
|
||||
|
||||
|
||||
for (int i = 0 ; i < Song::kColumns.size(); i++) {
|
||||
x++;
|
||||
|
||||
if (x >= q.columns_.size()) {
|
||||
qLog(Error) << "Skipping" << Song::kColumns.value(i);
|
||||
break;
|
||||
@@ -662,7 +660,7 @@ void Song::InitFromQuery(const SqlRow &q, bool reliable_metadata, int col) {
|
||||
}
|
||||
|
||||
else if (Song::kColumns.value(i) == "cue_path") {
|
||||
d->cue_path_ = tostr(col + x);
|
||||
d->cue_path_ = tostr(x);
|
||||
}
|
||||
|
||||
else {
|
||||
|
||||
@@ -112,8 +112,7 @@ class Song {
|
||||
void InitFromProtobuf(const pb::tagreader::SongMetadata &pb);
|
||||
void InitFromQuery(const SqlRow &query, bool reliable_metadata, int col = 0);
|
||||
void InitFromFilePartial(const QString &filename); // Just store the filename: incomplete but fast
|
||||
void InitArtManual(); // Check if there is already a art in the cache and
|
||||
// store the filename in art_manual
|
||||
void InitArtManual(); // Check if there is already a art in the cache and store the filename in art_manual
|
||||
#ifdef HAVE_LIBLASTFM
|
||||
void InitFromLastFM(const lastfm::Track &track);
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user