From 82dcb959d915107e72bcd43b2ce8e95023855c5e Mon Sep 17 00:00:00 2001 From: Anton Romanov Date: Thu, 10 Sep 2015 15:13:43 -0700 Subject: [PATCH] Use prettyname if description is missing in collection's settings, save trackcount when updating index --- data/js/tomahawk.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/data/js/tomahawk.js b/data/js/tomahawk.js index 5ea630c67..47f925f34 100644 --- a/data/js/tomahawk.js +++ b/data/js/tomahawk.js @@ -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; } };