Skip to content
This repository has been archived by the owner on Jan 19, 2023. It is now read-only.

Commit

Permalink
Merge branch 'development'
Browse files Browse the repository at this point in the history
  • Loading branch information
dirkgroenen committed Jan 17, 2016
2 parents 8331ef3 + b2eb459 commit b18191f
Show file tree
Hide file tree
Showing 16 changed files with 94 additions and 46 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
#Changelog

v1.5.14 (17-01-2016)
--------------------
- Fix QueueManager broken connection fixer

v1.5.13 (16-01-2016)
--------------------
- Fix broken queue [#177](https://github.com/dirkgroenen/mopidy-mopify/issues/177)
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion dist/assets/mopidy-mopify-1.5.13.js.map

This file was deleted.

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions dist/assets/mopidy-mopify-1.5.14.js.map

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions dist/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="apple-mobile-web-app-capable" content="yes">

<meta name="version" content="1.5.13">
<meta name="version" content="1.5.14">

<link href='https://fonts.googleapis.com/css?family=Roboto+Condensed:400,300,700' rel='stylesheet' type='text/css'>
<link rel="stylesheet" href="assets/webfonts/ss-standard.css">

<link href="assets/images/favicon.ico" rel="icon" type="image/x-icon" />


<link rel="stylesheet" type="text/css" href="assets/css/mopidy-mopify-1.5.13.css" />
<link rel="stylesheet" type="text/css" href="assets/css/mopidy-mopify-1.5.14.css" />

<link rel="manifest" href="assets/manifest.json">
</head>
Expand Down Expand Up @@ -55,7 +55,7 @@

<!-- Grunt will handle this part -->

<script type="text/javascript" src="assets/mopidy-mopify-1.5.13.js"></script>
<script type="text/javascript" src="assets/mopidy-mopify-1.5.14.js"></script>

<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
Expand Down
2 changes: 1 addition & 1 deletion mopidy_mopify/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

from mopidy import config, ext

__version__ = '1.5.13'
__version__ = '1.5.14'
__ext_name__ = 'mopify'
__verbosemode__ = False

Expand Down
2 changes: 1 addition & 1 deletion mopidy_mopify/static/debug/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="apple-mobile-web-app-capable" content="yes">

<meta name="version" content="1.5.13">
<meta name="version" content="1.5.14">

<link href='https://fonts.googleapis.com/css?family=Roboto+Condensed:400,300,700' rel='stylesheet' type='text/css'>
<link rel="stylesheet" href="assets/webfonts/ss-standard.css">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ angular.module('mopify.services.queuemanager', ['mopify.services.settings']).fac
// Setup websoclet
var protocol = typeof document !== 'undefined' && document.location.protocol === 'https:' ? 'wss://' : 'ws://';
var ws;
var recoveringDelay = 1000;
/**
* Send a request to the server's queuemanager class
*
Expand Down Expand Up @@ -94,13 +95,42 @@ angular.module('mopify.services.queuemanager', ['mopify.services.settings']).fac
var self = this;
$timeout(function () {
if (ws.readyState === 1) {
console.info('Websocket: connection ready');
wsconnection = true;
handleWaitlist();
} else {
self.checkConnectionReady();
}
}, 200);
};
/**
* Start revovering the websocket
* @return {[type]} [description]
*/
QueueManager.prototype.startRecovering = function () {
var that = this;
if (ws !== undefined) {
this.closeWebsocketConnection();
}
$timeout(function () {
that.setupWebsocket();
}, recoveringDelay);
recoveringDelay = recoveringDelay + 1000;
};
/**
* Formarly close the current websocket connection
* @return {[type]} [description]
*/
QueueManager.prototype.closeWebsocketConnection = function () {
ws.onopen = function () {
};
ws.onclose = function () {
};
ws.onerror = function () {
};
ws.onmessage = function () {
};
};
/**
* Setup all the data needed for the websocket communication
*
Expand All @@ -116,15 +146,8 @@ angular.module('mopify.services.queuemanager', ['mopify.services.settings']).fac
// Set connection to false on close
ws.onclose = function () {
wsconnection = false;
$timeout(function () {
that.setupWebsocket();
}, 2000);
};
ws.onerror = function (evt) {
wsconnection = false;
$timeout(function () {
that.setupWebsocket();
}, 2000);
ws.close();
that.startRecovering();
};
// Handle incoming messages
ws.onmessage = function (evt) {
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

This file was deleted.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions mopidy_mopify/static/min/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="apple-mobile-web-app-capable" content="yes">

<meta name="version" content="1.5.13">
<meta name="version" content="1.5.14">

<link href='https://fonts.googleapis.com/css?family=Roboto+Condensed:400,300,700' rel='stylesheet' type='text/css'>
<link rel="stylesheet" href="assets/webfonts/ss-standard.css">

<link href="assets/images/favicon.ico" rel="icon" type="image/x-icon" />


<link rel="stylesheet" type="text/css" href="assets/css/mopidy-mopify-1.5.13.css" />
<link rel="stylesheet" type="text/css" href="assets/css/mopidy-mopify-1.5.14.css" />

<link rel="manifest" href="assets/manifest.json">
</head>
Expand Down Expand Up @@ -55,7 +55,7 @@

<!-- Grunt will handle this part -->

<script type="text/javascript" src="assets/mopidy-mopify-1.5.13.js"></script>
<script type="text/javascript" src="assets/mopidy-mopify-1.5.14.js"></script>

<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "mopidy-mopify",
"author": "Dirk Groenen",
"version": "1.5.13",
"version": "1.5.14",
"description": "Webclient for Mopidy",
"repository": "https://github.com/dirkgroenen/mopidy-mopify",
"licenses": {
Expand Down
45 changes: 33 additions & 12 deletions src/app/services/queuemanager.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ angular.module("mopify.services.queuemanager", [
// Setup websoclet
var protocol = (typeof document !== "undefined" && document.location.protocol === "https:") ? "wss://" : "ws://";
var ws;
var recoveringDelay = 1000;

/**
* Send a request to the server's queuemanager class
Expand Down Expand Up @@ -111,6 +112,7 @@ angular.module("mopify.services.queuemanager", [

$timeout(function(){
if(ws.readyState === 1){
console.info("Websocket: connection ready");
wsconnection = true;
handleWaitlist();
}
Expand All @@ -120,6 +122,35 @@ angular.module("mopify.services.queuemanager", [
}, 200);
};

/**
* Start revovering the websocket
* @return {[type]} [description]
*/
QueueManager.prototype.startRecovering = function(){
var that = this;

if(ws !== undefined){
this.closeWebsocketConnection();
}

$timeout(function(){
that.setupWebsocket();
}, recoveringDelay);

recoveringDelay = recoveringDelay + 1000;
};

/**
* Formarly close the current websocket connection
* @return {[type]} [description]
*/
QueueManager.prototype.closeWebsocketConnection = function(){
ws.onopen = function(){};
ws.onclose = function(){};
ws.onerror = function(){};
ws.onmessage = function(){};
};

/**
* Setup all the data needed for the websocket communication
*
Expand All @@ -138,18 +169,8 @@ angular.module("mopify.services.queuemanager", [
// Set connection to false on close
ws.onclose = function(){
wsconnection = false;

$timeout(function(){
that.setupWebsocket();
}, 2000);
};

ws.onerror = function(evt) {
wsconnection = false;

$timeout(function(){
that.setupWebsocket();
}, 2000);
ws.close();
that.startRecovering();
};

// Handle incoming messages
Expand Down

0 comments on commit b18191f

Please sign in to comment.