From 5370b3db0d4b482a61db3b3bd7b6ff88ff0d6dda Mon Sep 17 00:00:00 2001 From: Peter Grassberger Date: Tue, 2 Feb 2016 20:06:44 +0100 Subject: musicpools: fix originDatetime and lastPlayDatetime render diff --git a/www/js/musicpools.js b/www/js/musicpools.js index bf906d0..7a880fd 100644 --- a/www/js/musicpools.js +++ b/www/js/musicpools.js @@ -204,9 +204,13 @@ Rivendell.MusicpoolCartView.prototype.render = function() { title = this.model.cuts[0].description; length = msToTimeString(Number(cut.length)); - imported = format_datetime(new Date(cut.originDatetime)); - playcnt = cut.playcnt; - lastplayed = format_datetime(new Date(cut.lastPlayDatetime)); + if (!isNaN(new Date(cut.originDatetime))) { + imported = format_datetime(new Date(cut.originDatetime)); + } + playcnt = cut.playCounter; + if (!isNaN(new Date(cut.lastPlayDatetime))) { + lastplayed = format_datetime(); + } } var deleteButton = $(''); diff --git a/www/js/rivendell.rh.js b/www/js/rivendell.rh.js index 8e58d01..a41ccd3 100644 --- a/www/js/rivendell.rh.js +++ b/www/js/rivendell.rh.js @@ -53,7 +53,7 @@ Rivendell.Rivendell.prototype.listDropboxes = function(type, success) { return $.post(this.listDropboxesEndpoint, command, success, 'xml'); }; -// see: https://github.com/ElvishArtisan/rivendell/pull/73 +// see: https://github.com/ElvishArtisan/rivendell/pull/100 Rivendell.Rivendell.prototype.addAndEditCut = function(cartNumber, options, success) { options.COMMAND = 10; options.LOGIN_NAME = this.username; -- cgit v0.10.2