mirror of
https://github.com/clementine-player/Clementine
synced 2025-01-18 20:40:43 +01:00
Merge pull request #4502 from gavinhoward/library_sort
Ignore Articles for Library Sorting
This commit is contained in:
commit
40b5499fc9
@ -464,7 +464,7 @@ QVariant LibraryModel::AlbumIcon(const QModelIndex& index) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Try to load it from the disk cache
|
// Try to load it from the disk cache
|
||||||
std::unique_ptr<QIODevice> cache (icon_cache_->data(QUrl(cache_key)));
|
std::unique_ptr<QIODevice> cache(icon_cache_->data(QUrl(cache_key)));
|
||||||
if (cache) {
|
if (cache) {
|
||||||
QImage cached_pixmap;
|
QImage cached_pixmap;
|
||||||
if (cached_pixmap.load(cache.get(), "XPM")) {
|
if (cached_pixmap.load(cache.get(), "XPM")) {
|
||||||
@ -508,7 +508,7 @@ void LibraryModel::AlbumArtLoaded(quint64 id, const QImage& image) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// if not already in the disk cache
|
// if not already in the disk cache
|
||||||
std::unique_ptr<QIODevice> cached_img (icon_cache_->data(QUrl(cache_key)));
|
std::unique_ptr<QIODevice> cached_img(icon_cache_->data(QUrl(cache_key)));
|
||||||
if (!cached_img) {
|
if (!cached_img) {
|
||||||
QNetworkCacheMetaData item_metadata;
|
QNetworkCacheMetaData item_metadata;
|
||||||
item_metadata.setSaveToDisk(true);
|
item_metadata.setSaveToDisk(true);
|
||||||
@ -1073,6 +1073,10 @@ QString LibraryModel::SortTextForArtist(QString artist) {
|
|||||||
|
|
||||||
if (artist.startsWith("the ")) {
|
if (artist.startsWith("the ")) {
|
||||||
artist = artist.right(artist.length() - 4) + ", the";
|
artist = artist.right(artist.length() - 4) + ", the";
|
||||||
|
} else if (artist.startsWith("a ")) {
|
||||||
|
artist = artist.right(artist.length() - 2) + ", a";
|
||||||
|
} else if (artist.startsWith("an ")) {
|
||||||
|
artist = artist.right(artist.length() - 3) + ", an";
|
||||||
}
|
}
|
||||||
|
|
||||||
return artist;
|
return artist;
|
||||||
|
Loading…
Reference in New Issue
Block a user