diff --git a/client/lib/stylesheets/_admin.scss b/client/lib/stylesheets/_admin.scss index 4a9ced13..56f17e19 100644 --- a/client/lib/stylesheets/_admin.scss +++ b/client/lib/stylesheets/_admin.scss @@ -73,6 +73,10 @@ padding-bottom: 2em; } +.admin-sidebar { + width: auto; +} + #at-btn, #at-nav-button { background-color: transparent; border: 1px solid #ccc; diff --git a/client/templates/admin/admin.html b/client/templates/admin/admin.html index 03f14ccf..2c9309f4 100644 --- a/client/templates/admin/admin.html +++ b/client/templates/admin/admin.html @@ -25,7 +25,7 @@

Admin

{{#if currentUser}}
-
+
  • General
  • Authentication
  • diff --git a/server/methods/admin/version.js b/server/methods/admin/version.js index 51145c57..02693015 100644 --- a/server/methods/admin/version.js +++ b/server/methods/admin/version.js @@ -4,31 +4,24 @@ Meteor.methods({ }, getVersion: function () { - return "1.20.6"; + // parse the version.txt file and return the contents + var fs = Npm.require('fs'); + return 'v' + fs.readFileSync(process.env.PWD + '/version.txt','utf8'); }, checkForUpdate : function () { - var branch = Meteor.call('getBranch'); var currentVersion = Meteor.call('getVersion'); + // Only the master branch is versioned and has tagged releases + if (Meteor.call('getBranch') === "master") { + try { + var latestJson = HTTP.call("GET", "https://api.github.com/repos/lokenx/plexrequests-meteor/releases/latest", {headers: {"User-Agent": "Plexrequests/" + currentVersion}}); + } + catch (err) { + logger.info("Error checking for update: " + err); + return false; + } - try { - var latestJson = HTTP.call("GET","https://api.github.com/repos/lokenx/plexrequests-meteor/contents/version.txt?ref=" + branch,{headers: {"User-Agent": "Meteor/1.1"}}); - } - catch (err) { - logger.log("Error checking for update: " + err); - return false; - } - - var latestJson64 = latestJson['data']['content']; - var latestVersion64 = new Buffer(latestJson64, "base64").toString(); - var latestVersion = latestVersion64.slice(0, - 1); - - if (latestVersion != currentVersion) { - logger.info("New update available"); - return true; - } else { - return false + return (latestJson.data.tag_name !== currentVersion); } } - }); diff --git a/version.txt b/version.txt index 7ad32779..8909929f 100644 --- a/version.txt +++ b/version.txt @@ -1 +1 @@ -1.20.6 \ No newline at end of file +1.20.7