Skip to content
This repository has been archived by the owner on Jun 26, 2024. It is now read-only.

Commit

Permalink
Merge pull request #176 from trazyn/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
衣带渐宽人渐悔 authored Jun 21, 2018
2 parents d5f622f + 808c501 commit dba202d
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 21 deletions.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
- Modern UI design
- High quality music(FLAC)
- Track your listen to Last.fm
- Fix dead music link [#3](https://github.com/trazyn/ieaseMusic/issues/3)(QQ music, Xiami music and Kugou music, fixed some bug, update on v1.1.5, basically all the songs can be played 🙊)
- Fix dead music link [#3](https://github.com/trazyn/ieaseMusic/issues/3)(QQ music, Xiami music and Kugou music, fixed some bug, update on v1.1.6, basically all the songs can be played 🙊)
- 就这些吧,编不下去了

## 海外党网解锁请参考
Expand All @@ -45,24 +45,24 @@
Download the last version on the [website](https://github.com/trazyn/ieaseMusic/releases/latest) or below.

#### Mac(10.9+)
[Download](https://github.com/trazyn/ieaseMusic/releases/download/v1.1.5/ieaseMusic-1.1.5-mac.dmg) the `.dmg` file, Or use `homebrew`:
[Download](https://github.com/trazyn/ieaseMusic/releases/download/v1.1.6/ieaseMusic-1.1.5-mac.dmg) the `.dmg` file, Or use `homebrew`:
```
brew cask install ieasemusic
```

#### Linux

[Download](https://github.com/trazyn/ieaseMusic/releases/download/v1.1.5/ieaseMusic-1.1.5-linux-amd64.deb) the `.deb` file for 'Debian / Ubuntu':
[Download](https://github.com/trazyn/ieaseMusic/releases/download/v1.1.6/ieaseMusic-1.1.5-linux-amd64.deb) the `.deb` file for 'Debian / Ubuntu':
```
$ sudo dpkg -i ieaseMusic-1.1.5-linux-amd64.deb
```

[Download](https://github.com/trazyn/ieaseMusic/releases/download/v1.1.5/ieaseMusic-1.1.5-linux-x86_64.rpm) the `.rpm` file for 'Centos/RHEL':
[Download](https://github.com/trazyn/ieaseMusic/releases/download/v1.1.6/ieaseMusic-1.1.5-linux-x86_64.rpm) the `.rpm` file for 'Centos/RHEL':
```
$ sudo yum localinstall ieaseMusic-1.1.5-linux-x86_64.rpm
```

[Download](https://github.com/trazyn/ieaseMusic/releases/download/v1.1.5/iease-music-1.1.5-x86_64.AppImage) the `.Appimage` file for other distribution:
[Download](https://github.com/trazyn/ieaseMusic/releases/download/v1.1.6/iease-music-1.1.5-x86_64.AppImage) the `.Appimage` file for other distribution:
```
$ chmod u+x iease-music-1.1.5-x86_64.AppImage
$ ./iease-music-1.1.5-x86_64.AppImage
Expand Down
5 changes: 4 additions & 1 deletion main.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import api from './server/api';

let debug = _debug('dev:main');
let error = _debug('dev:main:error');
let apiServer;
let forceQuit = false;
let downloading = false;
let autoUpdaterInit = false;
Expand Down Expand Up @@ -620,6 +621,7 @@ app.on('activate', e => {
mainWindow.show();
}
});
app.on('quit', () => apiServer && apiServer.close());

storage.get('preferences', (err, data) => {
var port = config.api.port;
Expand All @@ -635,7 +637,8 @@ storage.get('preferences', (err, data) => {
}

axios.defaults.baseURL = `http://localhost:${port}`;
api.listen(port, (err) => {

apiServer = api.listen(port, (err) => {
if (err) throw err;

debug(`API server is running with port ${port} 👊`);
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "iease-music",
"version": "1.1.5",
"version": "1.1.6",
"description": "这应该是最好的网易云音乐播放器了,没有之一,如果有请打醒 🤘",
"main": "main.js",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion server/api/loginCellphone.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ router.get('/', (req, res) => {
'POST',
data,
cookie,
(music_req, cookie) => {
(music_req, cookie = []) => {
cookie = cookie.map(x => x.replace("Domain=.music.163.com", ""))
res.set({
'Set-Cookie': cookie
Expand Down
30 changes: 17 additions & 13 deletions src/js/stores/controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,20 +101,24 @@ class Controller {
self.stop();

var song = self.song;
var response = await axios.get(
`/api/player/song/${song.id}/${encodeURIComponent(helper.clearWith(song.name, ['(', '(']))}/${encodeURIComponent(song.artists.map(e => e.name).join(','))}/${preferences.highquality}?` + +new Date(),
{
timeout: 5000,
cancelToken: new CancelToken(c => {
// An executor function receives a cancel function as a parameter
cancel = c;
})
}
);
var data = response.data.song;

if (!data.src) {
console.error('Bad audio src.');
try {
var response = await axios.get(
`/api/player/song/${song.id}/${encodeURIComponent(helper.clearWith(song.name, ['(', '(']))}/${encodeURIComponent(song.artists.map(e => e.name).join(','))}/${preferences.highquality}?` + +new Date(),
{
timeout: 5000,
cancelToken: new CancelToken(c => {
// An executor function receives a cancel function as a parameter
cancel = c;
})
}
);
var data = response.data.song;

if (!data.src) {
throw Error('Bad audio src.');
}
} catch (ex) {
self.next();
return;
}
Expand Down

0 comments on commit dba202d

Please sign in to comment.