Skip to content

Commit

Permalink
修复网易云导入歌单大于1000首失败问题,更改音乐详情页背景图片 (listen1#352)
Browse files Browse the repository at this point in the history
* 更新 netease.js

* Revert "更新 netease.js"

This reverts commit 647e223.

* 更新 netease.js

修复网易云音乐导入歌单超过1000首时失败问题

* Revert "更新 netease.js"

This reverts commit 13066b1.

* 修复网易云导入歌单大于1000首失败

网易云音乐歌单超过1000首会失败,传入id过多会被服务器拒绝

* 音乐详情页背景变为歌曲图片

歌曲详情页背景由纯白变为歌曲背景。
背景图片添加了滤镜,模糊处理,并加了一个跟随系统主题色变化的蒙版,保证歌词显示清晰
这个功能加上后音乐详情页视觉变动比较大,并不是所有人都喜欢,可以考虑变为一个开关

* 修改简约白当前歌词颜色

* 修改深空灰主题下歌词显示颜色

在深空灰主题下某些背景图歌词不是很清晰,修改一下颜色亮度,更清晰

* 优化大于1000首歌的bug处理

使用async库concat函数对异步代码控制更加简洁,对原有代码修改更少

Co-authored-by: YueShangGuan <YueShangGuan@users.noreply.github.com>
Co-authored-by: Listen 1 <githublisten1@gmail.com>
  • Loading branch information
3 people authored and Ericwyn committed Sep 22, 2020
1 parent 09bde85 commit a5deb07
Show file tree
Hide file tree
Showing 5 changed files with 49 additions and 16 deletions.
20 changes: 20 additions & 0 deletions css/common.css
Original file line number Diff line number Diff line change
Expand Up @@ -521,7 +521,27 @@ svg {
stroke: var(--now-playing-close-icon-color);
}

.page .bg {
opacity: 0.5;
height: 100%;
text-align: center;
line-height: 100%;
float: left;
width: 100%;
background-repeat: no-repeat;
background-position: center;
background-size: cover;
-webkit-filter: blur(15px);
-moz-filter: blur(15px);
-o-filter: blur(15px);
-ms-filter: blur(15px);
filter: blur(15px);
}

.page .playsong-detail {
position:absolute;
left: 10px;
right: 10px;
max-width: 770px;
margin: 0 auto;
display: flex;
Expand Down
4 changes: 2 additions & 2 deletions css/iparanoid.css
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
--text-subtitle-color: #666666;
--text-disable-color: #999999;

--lyric-default-color: #666666;
--lyric-default-color: #333333;

--link-default-color: #999999;
--link-highlight-color: #111111;
Expand All @@ -34,7 +34,7 @@

--window-control-border-color: #dddddd;

--important-color: #ff4444;
--important-color: #fff;

--button-background-color: #eeeeee;
--button-border-color: #bebebe;
Expand Down
2 changes: 1 addition & 1 deletion css/origin.css
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
--text-subtitle-color: #666666;
--text-disable-color: #999999;

--lyric-default-color: #666666;
--lyric-default-color: #bbbbbb;

--link-default-color: #999999;
--link-highlight-color: #ffffff;
Expand Down
23 changes: 17 additions & 6 deletions js/provider/netease.js
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,14 @@ function build_netease() {
return callback(null, tracks);
});
}
function split_array(myarray, size) {
var count = Math.ceil(myarray.length / size);
var result = [];
for (var i = 0; i < count; i++) {
result.push(myarray.slice(i * size, (i + 1) * size));
}
return result;
}

function ne_get_playlist(url, hm, se) {
// special thanks for @Binaryify
Expand Down Expand Up @@ -269,13 +277,16 @@ function build_netease() {
title: res_data.playlist.name,
source_url: `http://music.163.com/#/playlist?id=${list_id}`,
};
var max_allow_size = 1000;
var trackIdsArray = split_array(res_data.playlist.trackIds, max_allow_size);

function ng_parse_playlist_tracks_wrapper(trackIds, callback){
return ng_parse_playlist_tracks(trackIds, hm, se, callback);
}

// request all tracks to fetch song info
ng_parse_playlist_tracks(res_data.playlist.trackIds, hm, se,
(err, tracks) => fn({
tracks,
info,
}));
async.concat(trackIdsArray, ng_parse_playlist_tracks_wrapper, function(err, tracks){
fn({tracks, info});
});

// request every tracks to fetch song info
// async_process_list(res_data.playlist.trackIds, ng_render_playlist_result_item, [hm, se],
Expand Down
16 changes: 9 additions & 7 deletions listen1.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!DOCTYPE html>
<!DOCTYPE html>
<html lang="en" ng-app="listenone">

<head>
Expand Down Expand Up @@ -443,20 +443,22 @@ <h2>{{ playlist_title }}</h2>
</div>
<!-- now playing window-->
<div class="songdetail-wrapper" ng-class="{slidedown: window_type!=='track'}">
<div class="close" ng-class="isMac? 'mac':'' "ng-click="popWindow()"><svg class="icon"><use xlink:href="images/feather-sprite.svg#chevron-down"></use></svg></div>
<div class="bg" style="background-image: url({{ currentPlaying.img_url }});"></div>
<div class="close" ng-class="isMac? 'mac':'' " ng-click="popWindow()"><svg class="icon"><use xlink:href="images/feather-sprite.svg#chevron-down"></use></svg></div>

<div ng-if="!isChrome && !isMac" class="window-control">
<svg class="icon" window-control="window_min"><use xlink:href="images/feather-sprite.svg#minimize-2"></use></svg>
<svg class="icon" window-control="window_max"><use xlink:href="images/feather-sprite.svg#maximize" ></use></svg>
<svg class="icon" window-control="window_close"><use xlink:href="images/feather-sprite.svg#x"></use></svg>
<svg class="icon" window-control="window_min"><use xlink:href="images/feather-sprite.svg#minimize-2"></use></svg>
<svg class="icon" window-control="window_max"><use xlink:href="images/feather-sprite.svg#maximize"></use></svg>
<svg class="icon" window-control="window_close"><use xlink:href="images/feather-sprite.svg#x"></use></svg>
</div>

<div class="playsong-detail">
<div class="detail-head">
<div class="detail-head-cover"><img ng-src="{{ currentPlaying.img_url }}" err-src="https://y.gtimg.cn/mediastyle/global/img/album_300.png"/></div>
<div class="detail-head-cover"><img ng-src="{{ currentPlaying.img_url }}" err-src="https://y.gtimg.cn/mediastyle/global/img/album_300.png" /></div>
<div class="detail-head-title">
<!--<a title="加入收藏" class="clone" ng-click="showDialog(0, currentPlaying)">收藏</a>
<a open-url="currentPlaying.source_url" title="原始链接" class="link">原始链接</a>--></div>
<a open-url="currentPlaying.source_url" title="原始链接" class="link">原始链接</a>-->
</div>
</div>
<div class="detail-songinfo">
<h2>{{ currentPlaying.title }}</h2>
Expand Down

0 comments on commit a5deb07

Please sign in to comment.