Browse Source

Add documentation, fixed some bugs, tweaked design and added VSCode functionality

master
Leonie 3 weeks ago
parent
commit
2e8142606f
7 changed files with 208 additions and 10 deletions
  1. +32
    -1
      README.md
  2. +1
    -1
      config.xml
  3. +139
    -0
      package-lock.json
  4. +6
    -2
      package.json
  5. +6
    -5
      www/app.js
  6. +23
    -0
      www/player.js
  7. +1
    -1
      www/views/settingsview.html

+ 32
- 1
README.md View File

@@ -1,3 +1,34 @@
# Nordcast

Nordcast is a podcast streaming app by koyu.space
Nordcast is a podcast streaming app by koyu.space

## Building

### Prerequisites

- Visual Studio Code
- Visual Studio Code extension for Cordova
- NodeJS with NPM (Installation through `nvm` recommended)
- Cordova
- Optional: Android or iOS SDK
- Optional: Python 3 with PIP for the backend

### Building the app

Open the repository in Visual Studio Code and click the debugger on the left ribbon. From there you can choose many ways to run the app. If the simulator errors just continue, it may print errors into the console, but these are mostly gone in production builds. The app should behave quite well though.

### Using a local backend

Install the prerequisites for Python 3 with `sudo pip install -r requirements.txt` and then run the backend with `DEBUG=true python3 backend.py`. After that modify the `www/config.js` file and change the `backend` variable to your local backend. Usually this is `http://localhost:9000`. If you want to debug remotely replace `localhost` with your local IP address. Remotely debugging in the same network as your testing device is recommended and sufficient.

## Admin backend

If you need a graphical admin backend please have a look at the `admin.html` file in this repository. The default admin key is `x` and we recommend it to change to prevent unauthorized admin access by setting an environment variable called `ADMINKEY` when running the backend server.

## License

Please have a look at the `LICENSE.md` file. Nordcast is licensed under GPLv3.

## Help and Support

If you found a bug open an issue ticket. If you need help or found a critical security vulnerability, do not use public channels like the issue ticket function and instead contact koyu.space support at [email protected]

+ 1
- 1
config.xml View File

@@ -1,5 +1,5 @@
<?xml version='1.0' encoding='utf-8'?>
<widget id="com.Sommerlichter.nordcast" version="2.0.0" xmlns="http://www.w3.org/ns/widgets" xmlns:gap="http://phonegap.com/ns/1.0">
<widget id="com.Sommerlichter.nordcast" version="2.0.1" xmlns="http://www.w3.org/ns/widgets" xmlns:gap="http://phonegap.com/ns/1.0">
<name>Nordcast</name>
<description>
A new podcast app


+ 139
- 0
package-lock.json View File

@@ -503,6 +503,14 @@
}
}
},
"bplist-creator": {
"version": "0.0.8",
"resolved": "https://registry.npmjs.org/bplist-creator/-/bplist-creator-0.0.8.tgz",
"integrity": "sha512-Za9JKzD6fjLC16oX2wsXfc+qBEhJBJB1YPInoAQpMLhDuj5aVOv1baGeIQSq1Fr3OCqzvsoQcSBSwGId/Ja2PA==",
"requires": {
"stream-buffers": "~2.2.0"
}
},
"bplist-parser": {
"version": "0.1.1",
"resolved": "https://registry.npmjs.org/bplist-parser/-/bplist-parser-0.1.1.tgz",
@@ -1420,6 +1428,35 @@
"resolved": "https://registry.npmjs.org/cordova-file-cache/-/cordova-file-cache-1.2.2.tgz",
"integrity": "sha1-L5kQOIr9hkES5yZPpPjRk24B6bQ="
},
"cordova-ios": {
"version": "5.1.1",
"resolved": "https://registry.npmjs.org/cordova-ios/-/cordova-ios-5.1.1.tgz",
"integrity": "sha512-asZMCj44JMe/PMrDIRC97GStPCH+GpaMNVe8hdmu8WWXJzMzRNRRJ339YYU89jitWf9ZKMdyBgrnSnQi5bJ/ZQ==",
"requires": {
"cordova-common": "^3.1.0",
"ios-sim": "^8.0.1",
"nopt": "^4.0.1",
"plist": "^3.0.1",
"q": "^1.5.1",
"semver": "^6.3.0",
"shelljs": "^0.5.3",
"unorm": "^1.4.1",
"xcode": "^2.0.0",
"xml-escape": "^1.1.0"
},
"dependencies": {
"semver": {
"version": "6.3.0",
"resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz",
"integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw=="
},
"shelljs": {
"version": "0.5.3",
"resolved": "https://registry.npmjs.org/shelljs/-/shelljs-0.5.3.tgz",
"integrity": "sha1-xUmCuZbHbvDB5rWfvcWCX1txMRM="
}
}
},
"cordova-lib": {
"version": "9.0.1",
"resolved": "https://registry.npmjs.org/cordova-lib/-/cordova-lib-9.0.1.tgz",
@@ -1494,6 +1531,10 @@
"resolved": "https://registry.npmjs.org/cordova-plugin-globalization/-/cordova-plugin-globalization-1.11.0.tgz",
"integrity": "sha1-6sMVgQAphJOvowvolA5pj2HvvP4="
},
"cordova-plugin-music-controls2": {
"version": "git+https://github.com/ghenry22/cordova-music-controls-plugin.git#57c7fd4132f5fec478d33a9422987976440aafde",
"from": "git+https://github.com/ghenry22/cordova-music-controls-plugin.git"
},
"cordova-plugin-network-information": {
"version": "1.3.4",
"resolved": "https://registry.npmjs.org/cordova-plugin-network-information/-/cordova-plugin-network-information-1.3.4.tgz",
@@ -3614,6 +3655,32 @@
"resolved": "https://registry.npmjs.org/invert-kv/-/invert-kv-1.0.0.tgz",
"integrity": "sha1-EEqOSqym09jNFXqO+L+rLXo//bY="
},
"ios-sim": {
"version": "8.0.2",
"resolved": "https://registry.npmjs.org/ios-sim/-/ios-sim-8.0.2.tgz",
"integrity": "sha512-P7nEG771bfd+JoMRjnis1gpZOkjTUUxu+4Ek1Z+eoaEEoT9byllU9pxfQ8Df7hL3gSkIQxNwTSLhos2I8tWUQA==",
"requires": {
"bplist-parser": "^0.0.6",
"nopt": "1.0.9",
"plist": "^3.0.1",
"simctl": "^2"
},
"dependencies": {
"bplist-parser": {
"version": "0.0.6",
"resolved": "https://registry.npmjs.org/bplist-parser/-/bplist-parser-0.0.6.tgz",
"integrity": "sha1-ONo0cYF9+dRKs4kuJ3B7u9daEbk="
},
"nopt": {
"version": "1.0.9",
"resolved": "https://registry.npmjs.org/nopt/-/nopt-1.0.9.tgz",
"integrity": "sha1-O8DXy6e/sNWmdtvtfA6+SKT9RU4=",
"requires": {
"abbrev": "1"
}
}
}
},
"ip": {
"version": "1.1.3",
"resolved": "https://registry.npmjs.org/ip/-/ip-1.1.3.tgz",
@@ -5853,6 +5920,42 @@
"resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz",
"integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0="
},
"simctl": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/simctl/-/simctl-2.0.0.tgz",
"integrity": "sha512-5rB7rN4N3b0z0nFdy9eczVssXqrv2aAgdVRksPVqVoiDtvXmfzNvebp3EMdId2sAUzXIflarQlx4P0hjVQEzKQ==",
"requires": {
"shelljs": "^0.2.6",
"tail": "^0.4.0"
},
"dependencies": {
"shelljs": {
"version": "0.2.6",
"resolved": "https://registry.npmjs.org/shelljs/-/shelljs-0.2.6.tgz",
"integrity": "sha1-kEktcv/MgVmXa6umL7D2iE8MM3g="
}
}
},
"simple-plist": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/simple-plist/-/simple-plist-1.1.0.tgz",
"integrity": "sha512-2i5Tc0BYAqppM7jVzmNrI+aEUntPolIq4fDgji6WuNNn1D/qYdn2KwoLhZdzQkE04lu9L5tUoeJsjuJAvd+lFg==",
"requires": {
"bplist-creator": "0.0.8",
"bplist-parser": "0.2.0",
"plist": "^3.0.1"
},
"dependencies": {
"bplist-parser": {
"version": "0.2.0",
"resolved": "https://registry.npmjs.org/bplist-parser/-/bplist-parser-0.2.0.tgz",
"integrity": "sha512-z0M+byMThzQmD9NILRniCUXYsYpjwnlO8N5uCFaCqIOpqRsJCrQL9NK3JsD67CN5a08nF5oIL2bD6loTdHOuKw==",
"requires": {
"big-integer": "^1.6.44"
}
}
}
},
"slash": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/slash/-/slash-2.0.0.tgz",
@@ -6202,6 +6305,11 @@
"resolved": "https://registry.npmjs.org/statuses/-/statuses-1.5.0.tgz",
"integrity": "sha1-Fhx9rBd2Wf2YEfQ3cfqZOBR4Yow="
},
"stream-buffers": {
"version": "2.2.0",
"resolved": "https://registry.npmjs.org/stream-buffers/-/stream-buffers-2.2.0.tgz",
"integrity": "sha1-kdX1Ew0c75bc+n9yaUUYh0HQnuQ="
},
"string-width": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz",
@@ -6287,6 +6395,11 @@
"has-flag": "^3.0.0"
}
},
"tail": {
"version": "0.4.0",
"resolved": "https://registry.npmjs.org/tail/-/tail-0.4.0.tgz",
"integrity": "sha1-0p3nJ1DMmdseBTr/E8NZ7PtxMAI="
},
"tape": {
"version": "4.12.0",
"resolved": "https://registry.npmjs.org/tape/-/tape-4.12.0.tgz",
@@ -6529,6 +6642,11 @@
"resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz",
"integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg=="
},
"unorm": {
"version": "1.6.0",
"resolved": "https://registry.npmjs.org/unorm/-/unorm-1.6.0.tgz",
"integrity": "sha512-b2/KCUlYZUeA7JFUuRJZPUtr4gZvBh7tavtv4fvk4+KV9pfGiR6CQAQAWl49ZpR3ts2dk4FYkP7EIgDJoiOLDA=="
},
"unpipe": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz",
@@ -6973,6 +7091,22 @@
"resolved": "https://registry.npmjs.org/ws/-/ws-7.2.1.tgz",
"integrity": "sha512-sucePNSafamSKoOqoNfBd8V0StlkzJKL2ZAhGQinCfNQ+oacw+Pk7lcdAElecBF2VkLNZRiIb5Oi1Q5lVUVt2A=="
},
"xcode": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/xcode/-/xcode-2.1.0.tgz",
"integrity": "sha512-uCrmPITrqTEzhn0TtT57fJaNaw8YJs1aCzs+P/QqxsDbvPZSv7XMPPwXrKvHtD6pLjBM/NaVwraWJm8q83Y4iQ==",
"requires": {
"simple-plist": "^1.0.0",
"uuid": "^3.3.2"
},
"dependencies": {
"uuid": {
"version": "3.4.0",
"resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz",
"integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A=="
}
}
},
"xdg-basedir": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/xdg-basedir/-/xdg-basedir-2.0.0.tgz",
@@ -6981,6 +7115,11 @@
"os-homedir": "^1.0.0"
}
},
"xml-escape": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/xml-escape/-/xml-escape-1.1.0.tgz",
"integrity": "sha1-OQTBQ/qOs6ADDsZG0pAqLxtwbEQ="
},
"xmlbuilder": {
"version": "9.0.7",
"resolved": "https://registry.npmjs.org/xmlbuilder/-/xmlbuilder-9.0.7.tgz",


+ 6
- 2
package.json View File

@@ -4,7 +4,8 @@
"displayName": "Nordcast",
"cordova": {
"platforms": [
"android"
"android",
"ios"
],
"plugins": {
"cordova-plugin-device": {},
@@ -23,12 +24,14 @@
"ANDROID_PATHPREFIX": "/"
},
"cordova-music-controls": {},
"cordova-plugin-x-socialsharing": {}
"cordova-plugin-x-socialsharing": {},
"cordova-plugin-music-controls2": {}
}
},
"dependencies": {
"cordova-android": "^7.1.4",
"cordova-file-cache": "^1.2.2",
"cordova-ios": "^5.1.1",
"cordova-music-controls": "git+https://github.com/ghenry22/cordova-music-controls-plugin.git",
"cordova-plugin-customurlscheme": "5.0.0",
"cordova-plugin-darkmode": "1.0.0",
@@ -37,6 +40,7 @@
"cordova-plugin-file": "6.0.2",
"cordova-plugin-file-transfer": "1.7.1",
"cordova-plugin-globalization": "^1.0.9",
"cordova-plugin-music-controls2": "git+https://github.com/ghenry22/cordova-music-controls-plugin.git",
"cordova-plugin-network-information": "^1.3.4",
"cordova-plugin-statusbar": "^2.4.3",
"cordova-plugin-whitelist": "^1.3.4",


+ 6
- 5
www/app.js View File

@@ -185,7 +185,7 @@ function drr2() {
var reloaded = false;
window.setInterval(function() {
if (device.platform !== "browser") {
$.get(backend+"?"+Date.now(), function(data) {
$.get(backend+"/getstatus?"+Date.now(), function(data) {
localStorage.setItem("offline", "false");
if (findGetParameter("view") !== "settings") {
if (localStorage.getItem("offline") === "false") {
@@ -269,7 +269,7 @@ function drr2() {
localStorage.setItem("notifications", data);
}
});
}, 3000);
}, 10000);
$.get(backend+"/api/v1/login2/"+localStorage.getItem("username")+"/"+localStorage.getItem("uuid")+"/"+localStorage.getItem("instance"), function(data) {
if (localStorage.getItem("uuid") !== "dummy") {
if (data["login"] !== "ok" && data["uuid"] !== localStorage.getItem("uuid")) {
@@ -472,6 +472,7 @@ function drr2() {
if (Number(color.split(",")[0]) > 248 && localStorage.getItem("darkmode") === "true") {
$("#podcard").attr("style", "background-image: none;");
}
localStorage.setItem("color-"+Base64.encode(feed).slice(0, -3), color);
});
} else {
var color = localStorage.getItem("color-"+Base64.encode(feed).slice(0, -3));
@@ -1231,17 +1232,17 @@ function drr2() {
if (localStorage.getItem("lastloaded") !== null) {
if (goaltime < Number(localStorage.getItem("lastloaded"))) {
localStorage.setItem("lastloaded", Date.now());
timeout = podlist.split(",").length * 622;
timeout = (podlist.split(",").length * 622) / 2;
} else {
timeout = 3000;
}
} else {
localStorage.setItem("lastloaded", Date.now());
timeout = podlist.split(",").length * 622;
timeout = (podlist.split(",").length * 622) / 2;
}
if (firstload) {
localStorage.setItem("lastloaded", Date.now());
timeout = podlist.split(",").length * 622;
timeout = (podlist.split(",").length * 622) / 2;
}
window.setTimeout(function() {
window.setTimeout(function() {


+ 23
- 0
www/player.js View File

@@ -17,6 +17,10 @@ window.setTimeout(function() {
$("#player__controls").hide();
} else {
$("#player__controls").show();
bplay();
window.setTimeout(function() {
bplay();
}, 200);
}
if (findGetParameter("view") === "settings") {
$("#view__cast").hide();
@@ -839,6 +843,25 @@ function onDeviceReady() {
}, 1500);
}

window.setInterval(function() {
try {
var color = localStorage.getItem("color-"+Base64.encode(localStorage.getItem("feed")).slice(0, -3));
var style = "background:rgb(" + color.split("\n")[0] + ") !important;";
$(".rangeslider__fill").attr("style", $(".rangeslider__fill").attr("style").replaceAll(style) + style);
} catch (e) {}
}, 1500);

window.setInterval(function() {
var color = localStorage.getItem("color-"+Base64.encode(localStorage.getItem("feed")).slice(0, -3));
var style = "background:rgba(" + color.split("\n")[0] + ",.9) !important;";
$("#player__controls").css("background", style.replace("background:", "").replace(" !important;", ""));
if (Number(color.split(",")[0]) > 140) {
$("#player__controls").css("color", "#333");
} else {
$("#player__controls").css("color", "#fff");
}
}, 1500);

function ffw() {
var player = document.getElementById("player");
player.currentTime = player.currentTime + 10;


+ 1
- 1
www/views/settingsview.html View File

@@ -6,6 +6,6 @@
<p><span id="text__darkmode">Enable dark mode</span> <img src="darth.png" id="starwars" class="emoji"> <input id="cdark__mode" type="checkbox"></p>
<br />
<h2 id="text__about">About</h2>
<p>Nordcast <span id="version">2.0.0</span></p>
<p>Nordcast <span id="version">2.0.1</span></p>
<p><a href="#" onclick="window.open('https://nordcast.app', '_system'); return false;" id="text__website">Website</a> | <a href="#" onclick="window.open('https://git.koyu.space/koyu/nordcast', '_system'); return false;" id="text__sourcecode">Source code</a></p>
<p>&copy; koyu.space 2020</p>

Loading…
Cancel
Save