Guest User

Untitled

a guest
May 20th, 2018
139
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.30 KB | None | 0 0
  1. Index: Songkick.js
  2. ===================================================================
  3. --- Songkick.js (revision 10542)
  4. +++ Songkick.js (working copy)
  5. @@ -274,8 +274,7 @@
  6. return;
  7. var artist = item.getProperty(SBProperties.artistName);
  8. var url = this.getArtistUrl(artist);
  9. - // debugLog("onItemUpdated", "artist:" + artist + " // url:" + url);
  10. - if (url != null) {
  11. + if (this.getTourStatus(artist) && (url != null)) {
  12. debugLog("onItemUpdated", "New on tour item, artist: " + artist);
  13. // Set the touring properties for this track
  14. item.setProperty(this.onTourImgProperty, onTourIconSrc);
  15. @@ -883,9 +882,11 @@
  16. *********************************************************************/
  17. getTourStatus : function(artist) {
  18. this._db.resetQuery();
  19. - this._db.addQuery("SELECT count(*) FROM playing_at " +
  20. - "JOIN artists on artistid=artists.ROWID " +
  21. - 'where artists.name = "' + artist + '"');
  22. + this._db.addQuery('SELECT count(*) FROM playing_at ' +
  23. + 'JOIN artists on artistid=artists.ROWID ' +
  24. + 'JOIN concerts on concertid=concerts.id ' +
  25. + 'WHERE artists.name = "' + artist + '"' +
  26. + 'AND concerts.timestamp > ' + parseInt(Date.now()/1000));
  27. var ret = this._db.execute();
  28. var result = this._db.getResultObject();
  29. var count = result.getRowCell(0, 0);
Add Comment
Please, Sign In to add comment