diff --git a/index.js b/index.js
index 6a6f37f..ff9b3f7 100644
--- a/index.js
+++ b/index.js
@@ -1,4 +1,3 @@
-var pseudotvVersion = "0.5.3-testing";
const db = require('diskdb')
const fs = require('fs')
@@ -14,8 +13,9 @@ const HDHR = require('./src/hdhr')
const xmltv = require('./src/xmltv')
const Plex = require('./src/plex');
const channelCache = require('./src/channel-cache');
+const constants = require('./src/constants')
-console.log("PseudoTV Version: " + pseudotvVersion)
+console.log("PseudoTV Version: " + constants.VERSION_NAME)
for (let i = 0, l = process.argv.length; i < l; i++) {
if ((process.argv[i] === "-p" || process.argv[i] === "--port") && i + 1 !== l)
diff --git a/package.json b/package.json
index 510a669..2f79332 100644
--- a/package.json
+++ b/package.json
@@ -34,7 +34,6 @@
"dist/resources/**/*"
],
"targets": [
- "x86",
"x64",
"linux",
"macos",
diff --git a/src/api.js b/src/api.js
index 57c6ec8..49cc971 100644
--- a/src/api.js
+++ b/src/api.js
@@ -3,11 +3,16 @@ const express = require('express')
const fs = require('fs')
const defaultSettings = require('./defaultSettings')
const channelCache = require('./channel-cache')
+const constants = require('./constants')
module.exports = { router: api }
function api(db, xmltvInterval) {
let router = express.Router()
+ router.get('/api/version', (req, res) => {
+ res.send( { "pseudotv" : constants.VERSION_NAME } )
+ })
+
// Plex Servers
router.get('/api/plex-servers', (req, res) => {
let servers = db['plex-servers'].find()
diff --git a/src/constants.js b/src/constants.js
index bfdf8ea..fe3eac6 100644
--- a/src/constants.js
+++ b/src/constants.js
@@ -1,3 +1,4 @@
module.exports = {
SLACK: 9999,
+ VERSION_NAME: "0.5.4"
}
\ No newline at end of file
diff --git a/web/app.js b/web/app.js
index d032d0c..910c95e 100644
--- a/web/app.js
+++ b/web/app.js
@@ -20,6 +20,7 @@ app.directive('channelConfig', require('./directives/channel-config'))
app.controller('settingsCtrl', require('./controllers/settings'))
app.controller('channelsCtrl', require('./controllers/channels'))
+app.controller('versionCtrl', require('./controllers/version'))
app.config(function ($routeProvider) {
$routeProvider
@@ -31,6 +32,10 @@ app.config(function ($routeProvider) {
templateUrl: "views/channels.html",
controller: 'channelsCtrl'
})
+ .when("/version", {
+ templateUrl: "views/version.html",
+ controller: 'versionCtrl'
+ })
.otherwise({
redirectTo: "channels"
})
diff --git a/web/controllers/version.js b/web/controllers/version.js
new file mode 100644
index 0000000..0979029
--- /dev/null
+++ b/web/controllers/version.js
@@ -0,0 +1,8 @@
+module.exports = function ($scope, pseudotv) {
+ $scope.version = "Getting PseudoTV version..."
+ pseudotv.getVersion().then((version) => {
+ $scope.version = version.pseudotv
+ })
+
+
+}
\ No newline at end of file
diff --git a/web/public/index.html b/web/public/index.html
index 05b7810..7195b3b 100644
--- a/web/public/index.html
+++ b/web/public/index.html
@@ -18,7 +18,7 @@
- Channels - Settings
+ Channels - Settings - Version
XMLTV
diff --git a/web/public/views/version.html b/web/public/views/version.html
new file mode 100644
index 0000000..ee87ad0
--- /dev/null
+++ b/web/public/views/version.html
@@ -0,0 +1,18 @@
+
+
+
+ Version Info
+
+
+
+ | Component |
+ Version |
+
+
+ | PseudoTV |
+ {{version}} |
+
+
+
+
+
\ No newline at end of file
diff --git a/web/services/pseudotv.js b/web/services/pseudotv.js
index 71725ad..f2d80c0 100644
--- a/web/services/pseudotv.js
+++ b/web/services/pseudotv.js
@@ -1,5 +1,8 @@
module.exports = function ($http) {
return {
+ getVersion: () => {
+ return $http.get('/api/version').then((d) => { return d.data })
+ },
getPlexServers: () => {
return $http.get('/api/plex-servers').then((d) => { return d.data })
},