media library: sort track numbers as integers, not strings
This commit is contained in:
1
NEWS
1
NEWS
@@ -27,6 +27,7 @@ ncmpcpp-0.7 (????-??-??)
|
|||||||
* Sorting actions were rebound to Ctrl-S.
|
* Sorting actions were rebound to Ctrl-S.
|
||||||
* Support for range selection was added (bound to Ctrl-V by default). In addition, sorting, reversing and shuffling items in playlist now works on ranges.
|
* Support for range selection was added (bound to Ctrl-V by default). In addition, sorting, reversing and shuffling items in playlist now works on ranges.
|
||||||
* Support for selecting found items was added (bound to Ctrl-_ by default).
|
* Support for selecting found items was added (bound to Ctrl-_ by default).
|
||||||
|
* Tracks in media library are now properly sorted for track numbers greater than 99.
|
||||||
|
|
||||||
ncmpcpp-0.6.5 (2015-07-05)
|
ncmpcpp-0.6.5 (2015-07-05)
|
||||||
|
|
||||||
|
|||||||
@@ -106,7 +106,13 @@ public:
|
|||||||
if (ret != 0)
|
if (ret != 0)
|
||||||
return ret < 0;
|
return ret < 0;
|
||||||
}
|
}
|
||||||
return a.getTrack() < b.getTrack();
|
try {
|
||||||
|
int ret = boost::lexical_cast<int>(a.getTags(&MPD::Song::getTrackNumber))
|
||||||
|
- boost::lexical_cast<int>(b.getTags(&MPD::Song::getTrackNumber));
|
||||||
|
return ret < 0;
|
||||||
|
} catch (boost::bad_lexical_cast &) {
|
||||||
|
return a.getTrackNumber() < b.getTrackNumber();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user