1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-07-31 19:30:21 +02:00

Use prettyname if description is missing in collection's settings, save trackcount when updating index

This commit is contained in:
Anton Romanov
2015-09-10 15:13:43 -07:00
parent 1d750b25a9
commit 82dcb959d9

View File

@@ -1496,6 +1496,7 @@ Tomahawk.Collection = {
t.sqlSelect("tracks", resultMap, ["_id", "artistId", "albumId", "track"]);
return t.execDefferedStatements();
}).then(function (results) {
that._trackCount = results[0].length;
Tomahawk.log("Added " + results[0].length + " tracks to collection '" + id + "'");
// Add the db ids together with the basic metadata to the fuzzy index list
var fuzzyIndexList = [];
@@ -1788,6 +1789,9 @@ Tomahawk.Collection = {
},
collection: function () {
this.settings.trackcount = this._trackCount;
if(! this.settings.description)
this.settings.description = this.settings.prettyname;
return this.settings;
}
};