diff --git a/README.md b/README.md index 9c6f505..4985746 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -Listen 1 (Chrome Extension) (最后更新于5月8日) +Listen 1 (Chrome Extension) (最后更新于5月13日) ========== [![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg)](LICENSE) @@ -28,6 +28,16 @@ Listen 1 (Chrome Extension) (最后更新于5月8日) 更新日志 ------- +`2016-05-13` + +* 增加我的歌单功能,可以收藏现有歌单,并创建自己的歌单 +* 点击Listen 1和图标可以回到首页 +* 标记了部分因版权无法播放的歌曲,增加版权提示 +* 重构了音乐平台代码,使用统一的接口规范 +* 重构了歌单接口,合并歌手,专辑和歌单接口 +* 修复了阿里云歌手链接点击错误的bug + + `2016-05-08` * 增加歌词显示 @@ -43,7 +53,7 @@ Listen 1 (Chrome Extension) (最后更新于5月8日) TODO ---- -加入我的歌单功能(如迫不及待需要,可以安装Listen 1非插件版) +分页加载 License diff --git a/css/player.css b/css/player.css index 7ba9ecb..c3a0283 100644 --- a/css/player.css +++ b/css/player.css @@ -76,6 +76,12 @@ a { height: 50px; width: 50px; margin-right: 20px; + cursor: pointer; +} + +.masthead .masthead-brand { + color: rgba(255,255,255, 1); + cursor: pointer; } .cover-container { @@ -428,7 +434,7 @@ em, i { right: 0px; bottom: 48px; z-index: 10; - width: 79px; + width: 103px; padding-left: 13px; float: none; } @@ -490,6 +496,10 @@ em, i { text-indent: -9999px; } +.m-playbar .icn-add { + margin-right: 5px; +} + .m-playbar .menu { position: absolute; bottom: 90px; @@ -717,7 +727,7 @@ li { background-position: -256px -36px; } -.playlist-detail .detail-head-title .delete { +.playlist-detail .detail-head-title .edit { display: inline-block; text-indent: -9999px; width: 36px; @@ -725,12 +735,12 @@ li { margin-right: 8px; margin-top: 0; background: url(../images/player_large.png) no-repeat 0 9999px; - background-position: -180px 0px; + background-position: -288px 0px; } -.playlist-detail .detail-head-title .delete:hover { +.playlist-detail .detail-head-title .edit:hover { background: url(../images/player_large.png) no-repeat 0 9999px; - background-position: -180px -36px; + background-position: -288px -36px; } .playlist-detail .detail-head-title .clone { @@ -789,6 +799,10 @@ li { margin-left: 2%; } +.detail-songlist .disabled { + color: #777777; +} + .detail-songlist .col-add { float: left; width: 75px; @@ -920,7 +934,18 @@ li { } .dialog-newplaylist .confirm-button { - margin-right: 64px; + margin-left: 76px; + margin-right: 96px; +} + +.dialog-editplaylist .dialog-footer { + position: absolute; + bottom: 20px; +} + +.dialog-editplaylist .confirm-button { + margin-right: 82px; + margin-left: 93px; } .source-list { diff --git a/images/player_large.png b/images/player_large.png index a286317..7e5259e 100644 Binary files a/images/player_large.png and b/images/player_large.png differ diff --git a/js/app.js b/js/app.js index 57f3340..d6822e2 100644 --- a/js/app.js +++ b/js/app.js @@ -68,6 +68,7 @@ $scope.dialog_title = ''; $scope.isDoubanLogin = false; + $scope.$on('isdoubanlogin:update', function(event, data) { $scope.isDoubanLogin = data; }); @@ -104,7 +105,7 @@ $scope.playlist_title = data.info.title; $scope.playlist_source_url = data.info.source_url; $scope.list_id = data.info.id; - $scope.is_mine = data.is_mine; + $scope.is_mine = (data.info.id.slice(0,2) == 'my'); }); }; @@ -124,9 +125,11 @@ var url = $scope.window_url_stack[$scope.window_url_stack.length-1]; loWeb.get(url).success(function(data) { $scope.songs = data.tracks; + $scope.list_id = data.info.id; $scope.cover_img_url = data.info.cover_img_url; $scope.playlist_title = data.info.title; $scope.playlist_source_url = data.info.source_url; + $scope.is_mine = (data.info.id.slice(0,2) == 'my'); }); } }; @@ -136,16 +139,6 @@ $scope.showWindow(url); }; - $scope.showArtist = function(artist_id) { - var url = '/artist?artist_id=' + artist_id; - $scope.showWindow(url); - }; - - $scope.showAlbum = function(album_id) { - var url = '/album?album_id=' + album_id; - $scope.showWindow(url); - }; - $scope.directplaylist = function(list_id){ var url = '/playlist?list_id=' + list_id; @@ -182,7 +175,7 @@ $scope.dialog_title = '添加到歌单'; var url = '/show_myplaylist'; $scope.dialog_song = data; - $http.get(url).success(function(data) { + loWeb.get(url).success(function(data) { $scope.myplaylist = data.result; }); } @@ -191,25 +184,23 @@ $scope.dialog_title = '登录豆瓣'; $scope.dialog_type = 2; } + + if (dialog_type == 3) { + $scope.dialog_title = '修改歌单'; + $scope.dialog_type = 3; + $scope.dialog_cover_img_url = data.cover_img_url; + $scope.dialog_playlist_title = data.playlist_title; + } }; $scope.chooseDialogOption = function(option_id) { var url = '/add_myplaylist'; - - $http({ + loWeb.post({ url: url, method: 'POST', data: $httpParamSerializerJQLike({ list_id: option_id, - id: $scope.dialog_song.id, - title: $scope.dialog_song.title, - artist: $scope.dialog_song.artist, - url: $scope.dialog_song.url, - artist_id: $scope.dialog_song.artist_id, - album: $scope.dialog_song.album, - album_id: $scope.dialog_song.album_id, - source: $scope.dialog_song.source, - source_url: $scope.dialog_song.source_url + track: JSON.stringify($scope.dialog_song) }), headers: { 'Content-Type': 'application/x-www-form-urlencoded' @@ -235,20 +226,12 @@ $scope.createAndAddPlaylist = function() { var url = '/create_myplaylist'; - $http({ + loWeb.post({ url: url, method: 'POST', data: $httpParamSerializerJQLike({ list_title: $scope.newlist_title, - id: $scope.dialog_song.id, - title: $scope.dialog_song.title, - artist: $scope.dialog_song.artist, - url: $scope.dialog_song.url, - artist_id: $scope.dialog_song.artist_id, - album: $scope.dialog_song.album, - album_id: $scope.dialog_song.album_id, - source: $scope.dialog_song.source, - source_url: $scope.dialog_song.source_url + track: JSON.stringify($scope.dialog_song) }), headers: { 'Content-Type': 'application/x-www-form-urlencoded' @@ -260,10 +243,33 @@ }); }; + $scope.editMyPlaylist = function() { + var url = '/edit_myplaylist'; + + loWeb.post({ + url: url, + method: 'POST', + data: $httpParamSerializerJQLike({ + list_id: $scope.list_id, + title: $scope.dialog_playlist_title, + cover_img_url: $scope.dialog_cover_img_url + }), + headers: { + 'Content-Type': 'application/x-www-form-urlencoded' + } + }).success(function() { + $rootScope.$broadcast('myplaylist:update'); + $scope.playlist_title = $scope.dialog_playlist_title; + $scope.cover_img_url = $scope.dialog_cover_img_url; + Notification.success('修改歌单成功'); + $scope.closeDialog(); + }); + }; + $scope.removeSongFromPlaylist = function(song, list_id) { var url = '/remove_track_from_myplaylist'; - $http({ + loWeb.post({ url: url, method: 'POST', data: $httpParamSerializerJQLike({ @@ -318,6 +324,48 @@ }, 0); }; + $scope.copyrightNotice = function() { + Notification.info("版权原因无法播放,请搜索其他平台"); + }; + + $scope.clonePlaylist = function(list_id){ + var url = '/clone_playlist'; + loWeb.post({ + url: url, + method: 'POST', + data: $httpParamSerializerJQLike({ + list_id: list_id, + }), + headers: { + 'Content-Type': 'application/x-www-form-urlencoded' + } + }).success(function() { + $rootScope.$broadcast('myplaylist:update'); + $scope.closeWindow(); + Notification.success('收藏到我的歌单成功'); + }); + }; + + $scope.removeMyPlaylist = function(list_id){ + var url = '/remove_myplaylist'; + + loWeb.post({ + url: url, + method: 'POST', + data: $httpParamSerializerJQLike({ + list_id: list_id, + }), + headers: { + 'Content-Type': 'application/x-www-form-urlencoded' + } + }).success(function() { + $rootScope.$broadcast('myplaylist:update'); + $scope.closeDialog(); + $scope.closeWindow(); + Notification.success('删除歌单成功'); + }); + }; + }]); app.controller('PlayController', ['$scope', '$timeout','$log', @@ -461,46 +509,6 @@ angularPlayer.mute(); } - - - $scope.removemylist = function(list_id){ - var url = '/remove_myplaylist'; - - $http({ - url: url, - method: 'POST', - data: $httpParamSerializerJQLike({ - list_id: list_id, - }), - headers: { - 'Content-Type': 'application/x-www-form-urlencoded' - } - }).success(function() { - $rootScope.$broadcast('myplaylist:update'); - $scope.closeWindow(); - Notification.success('删除成功'); - }); - }; - - $scope.clonelist = function(list_id){ - var url = '/clone_playlist'; - - $http({ - url: url, - method: 'POST', - data: $httpParamSerializerJQLike({ - list_id: list_id, - }), - headers: { - 'Content-Type': 'application/x-www-form-urlencoded' - } - }).success(function() { - $rootScope.$broadcast('myplaylist:update'); - $scope.closeWindow(); - Notification.success('收藏到我的歌单成功'); - }); - }; - $scope.myProgress = 0; $scope.changingProgress = false; @@ -607,6 +615,9 @@ } loWeb.get(url).success(function(data) { var lyric = data.lyric; + if (lyric == null) { + return; + } $scope.lyricArray = parseLyric(lyric); }); }); @@ -627,7 +638,6 @@ var lineElement = $(".lyric p")[lastObject.lineNumber]; var windowHeight = 270; var offset = lineElement.offsetTop - windowHeight/2; - //$(".lyric").scrollTop(offset); $(".lyric").animate({ scrollTop: offset+"px" }, 500); $scope.lyricLineNumber = lastObject.lineNumber; } @@ -840,11 +850,12 @@ }]); app.controller('MyPlayListController', ['$http','$scope', '$timeout', - 'angularPlayer', function($http, $scope, $timeout, angularPlayer){ + 'angularPlayer', 'loWeb', + function($http, $scope, $timeout, angularPlayer, loWeb){ $scope.myplaylists = []; $scope.loadMyPlaylist = function(){ - $http.get('/show_myplaylist').success(function(data) { + loWeb.get('/show_myplaylist').success(function(data) { $scope.myplaylists = data.result; }); }; @@ -876,10 +887,6 @@ loWeb.get('/show_playlist?source=' + getSourceName($scope.tab)).success(function(data) { $scope.result = data.result; }); - - // $http.get('/show_playlist?source=' + $scope.tab).success(function(data) { - // $scope.result = data.result; - // }); }; $scope.isActiveTab = function(tab){ diff --git a/js/loweb.js b/js/loweb.js index e9e2e23..03cf785 100644 --- a/js/loweb.js +++ b/js/loweb.js @@ -23,6 +23,9 @@ function getProviderByItemId(itemId) { if (prefix == 'qq') { return qq; } + if (prefix == 'my') { + return myplaylist; + } } ngloWebManager.factory('loWeb', ['$rootScope', '$log', '$http', '$httpParamSerializerJQLike', @@ -37,29 +40,88 @@ function($rootScope, $log, $http, $httpParamSerializerJQLike) { if (url.search('/playlist') != -1) { var list_id = getParameterByName('list_id', url); var provider = getProviderByItemId(list_id); - return provider.get_playlist(url, $http); + return provider.get_playlist(url, $http, $httpParamSerializerJQLike); } if (url.search('/search') != -1) { var source = getParameterByName('source', url); var provider = getProviderByName(source); return provider.search(url, $http, $httpParamSerializerJQLike); } - if (url.search('/album') != -1) { - var album_id = getParameterByName('album_id', url); - var provider = getProviderByItemId(album_id); - return provider.album(url, $http, $httpParamSerializerJQLike); - } - if (url.search('/artist') != -1) { - var artist_id = getParameterByName('artist_id', url); - var provider = getProviderByItemId(artist_id); - return provider.artist(url, $http, $httpParamSerializerJQLike); - } if (url.search('/lyric') != -1) { var track_id = getParameterByName('track_id', url); var provider = getProviderByItemId(track_id); return provider.lyric(url, $http, $httpParamSerializerJQLike); } - + if (url.search('/show_myplaylist') != -1) { + return myplaylist.show_myplaylist(); + } + }, + post: function(request) { + if (request.url.search('/clone_playlist') != -1) { + var list_id = getParameterByName('list_id', url+'?'+request.data); + var provider = getProviderByItemId(list_id); + var url = '/playlist?list_id=' + list_id; + return { + success: function(fn) { + provider.get_playlist(url, $http).success(function(data){ + myplaylist.save_myplaylist(data); + fn(); + }); + } + }; + } + if (request.url.search('/remove_myplaylist') != -1) { + var list_id = getParameterByName('list_id', url+'?'+request.data); + myplaylist.remove_myplaylist(list_id); + return { + success: function(fn) { + fn(); + } + }; + } + if (request.url.search('/add_myplaylist') != -1) { + var list_id = getParameterByName('list_id', url+'?'+request.data); + var track_json = getParameterByName('track', url+'?'+request.data); + var track = JSON.parse(track_json); + myplaylist.add_myplaylist(list_id, track); + return { + success: function(fn) { + fn(); + } + }; + } + if (request.url.search('/remove_track_from_myplaylist') != -1) { + var list_id = getParameterByName('list_id', url+'?'+request.data); + var track_id = getParameterByName('track_id', url+'?'+request.data); + myplaylist.remove_from_myplaylist(list_id, track_id); + return { + success: function(fn) { + fn(); + } + }; + } + if (request.url.search('/create_myplaylist') != -1) { + var list_title = getParameterByName('list_title', url+'?'+request.data); + var track_json = getParameterByName('track', url+'?'+request.data); + var track = JSON.parse(track_json); + myplaylist.create_myplaylist(list_title, track); + return { + success: function(fn) { + fn(); + } + }; + } + if (request.url.search('/edit_myplaylist') != -1) { + var list_id = getParameterByName('list_id', url+'?'+request.data); + var title = getParameterByName('title', url+'?'+request.data); + var cover_img_url = getParameterByName('cover_img_url', url+'?'+request.data); + myplaylist.edit_myplaylist(list_id, title, cover_img_url); + return { + success: function(fn) { + fn(); + } + }; + } }, bootstrapTrack: function(success, failure) { return function(sound, track, callback){ diff --git a/js/myplaylist.js b/js/myplaylist.js new file mode 100644 index 0000000..d621533 --- /dev/null +++ b/js/myplaylist.js @@ -0,0 +1,138 @@ +var myplaylist = (function() { + 'use strict'; + +var show_myplaylist = function() { + return { + success: function(fn){ + var playlists = localStorage.getObject('playerlists'); + if (playlists == null) { + playlists = []; + } + var result = []; + for (var i=0; i= 0) && (song.fee != 4)); + } + var ne_search = function(url, hm, se) { // use chrome extension to modify referer. var target_url = 'http://music.163.com/api/search/pc'; @@ -220,9 +226,6 @@ var netease = (function() { }).success(function(data) { var tracks = []; $.each(data.result.songs, function(index, song_info) { - if (song_info.status == -1) { - return; - } var default_track = { 'id': 'netrack_' + song_info.id, 'title': song_info.name, @@ -233,8 +236,14 @@ var netease = (function() { 'source': 'netease', 'source_url': 'http://music.163.com/#/song?id=' + song_info.id, 'img_url': song_info.album.picUrl, - 'url': 'netrack_' + song_info.id + 'url': 'netrack_' + song_info.id, }; + if (!is_playable(song_info)) { + default_track.disabled = true; + } + else { + default_track.disabled = false; + } tracks.push(default_track); }); return fn({"result":tracks}); @@ -245,7 +254,7 @@ var netease = (function() { var ne_album = function(url, hm, se) { - var album_id = getParameterByName('album_id', url).split('_').pop(); + var album_id = getParameterByName('list_id', url).split('_').pop(); // use chrome extension to modify referer. var target_url = 'http://music.163.com/api/album/' + album_id; @@ -276,16 +285,22 @@ var netease = (function() { 'img_url': song_info.album.picUrl, 'url': 'netrack_' + song_info.id }; + if (!is_playable(song_info)) { + default_track.disabled = true; + } + else { + default_track.disabled = false; + } tracks.push(default_track); }); - return fn({"tracks":tracks, "info":info, "is_mine": 0}); + return fn({"tracks":tracks, "info":info}); }); } }; } var ne_artist = function(url, hm, se) { - var artist_id = getParameterByName('artist_id', url).split('_').pop(); + var artist_id = getParameterByName('list_id', url).split('_').pop(); // use chrome extension to modify referer. var target_url = 'http://music.163.com/api/artist/' + artist_id; @@ -316,9 +331,15 @@ var netease = (function() { 'img_url': song_info.album.picUrl, 'url': 'netrack_' + song_info.id }; + if (!is_playable(song_info)) { + default_track.disabled = true; + } + else { + default_track.disabled = false; + } tracks.push(default_track); }); - return fn({"tracks":tracks, "info":info, "is_mine": 0}); + return fn({"tracks":tracks, "info":info}); }); } }; @@ -356,13 +377,24 @@ var netease = (function() { }; } +var get_playlist = function(url, hm, se) { + var list_id = getParameterByName('list_id', url).split('_')[0]; + if (list_id == 'neplaylist') { + return ne_get_playlist(url, hm, se); + } + if (list_id == 'nealbum') { + return ne_album(url, hm, se); + } + if (list_id == 'neartist') { + return ne_artist(url, hm, se); + } +} + return { show_playlist: ne_show_playlist, - get_playlist: ne_get_playlist, + get_playlist: get_playlist, bootstrap_track: ne_bootstrap_track, search: ne_search, - album: ne_album, - artist: ne_artist, lyric: ne_lyric, }; diff --git a/js/qq.js b/js/qq.js index 8cf0863..d446ab9 100644 --- a/js/qq.js +++ b/js/qq.js @@ -29,7 +29,7 @@ var qq = (function() { var d = { 'cover_img_url': item.imgurl, 'title': htmlDecode(item.dissname), - 'list_id':'qqplaylist_' + item.dissid, + 'id':'qqplaylist_' + item.dissid, 'source_url': 'http://y.qq.com/#type=taoge&id=' + item.dissid }; @@ -67,7 +67,8 @@ var qq = (function() { 'source': 'qq', 'source_url': 'http://y.qq.com/#type=song&mid=' + song.songmid + '&tpl=yqq_song_detail', - 'url': 'qqtrack_' + song.songmid + 'url': 'qqtrack_' + song.songmid, + 'disabled': !qq_is_playable(song) } return d } @@ -83,7 +84,7 @@ var qq = (function() { return ((play_flag == 1) || ((play_flag == 1) && (try_flag == 1))); } - var qq_get_playlist = function(url, hm) { + var qq_get_playlist = function(url, hm, se) { var list_id = getParameterByName('list_id', url).split('_').pop(); return { @@ -111,10 +112,8 @@ var qq = (function() { var tracks = []; $.each(data.cdlist[0].songlist, function(index, item){ - if (qq_is_playable(item)) { - var track = qq_convert_song(item); - tracks.push(track); - } + var track = qq_convert_song(item); + tracks.push(track); }); return fn({"tracks":tracks, "info":info}); }); @@ -123,7 +122,7 @@ var qq = (function() { } var qq_album = function(url, hm) { - var album_id = getParameterByName('album_id', url).split('_').pop(); + var album_id = getParameterByName('list_id', url).split('_').pop(); return { success: function(fn) { @@ -150,10 +149,8 @@ var qq = (function() { var tracks = []; $.each(data.data.list, function(index, item){ - if (qq_is_playable(item)) { - var track = qq_convert_song(item); - tracks.push(track); - } + var track = qq_convert_song(item); + tracks.push(track); }); return fn({"tracks":tracks, "info":info}); }); @@ -162,7 +159,7 @@ var qq = (function() { } var qq_artist = function(url, hm) { - var artist_id = getParameterByName('artist_id', url).split('_').pop(); + var artist_id = getParameterByName('list_id', url).split('_').pop(); return { success: function(fn) { @@ -190,10 +187,8 @@ var qq = (function() { var tracks = []; $.each(data.data.list, function(index, item){ - if (qq_is_playable(item.musicData)) { - var track = qq_convert_song(item.musicData); - tracks.push(track); - } + var track = qq_convert_song(item.musicData); + tracks.push(track); }); return fn({"tracks":tracks, "info":info}); }); @@ -221,10 +216,8 @@ var qq = (function() { data = JSON.parse(data); var tracks = []; $.each(data.data.song.list, function(index, item){ - if (qq_is_playable(item)) { - var track = qq_convert_song(item); - tracks.push(track); - } + var track = qq_convert_song(item); + tracks.push(track); }); return fn({"result":tracks}); }); @@ -291,13 +284,25 @@ var qq = (function() { }; } + +var get_playlist = function(url, hm, se) { + var list_id = getParameterByName('list_id', url).split('_')[0]; + if (list_id == 'qqplaylist') { + return qq_get_playlist(url, hm, se); + } + if (list_id == 'qqalbum') { + return qq_album(url, hm, se); + } + if (list_id == 'qqartist') { + return qq_artist(url, hm, se); + } +} + return { show_playlist: qq_show_playlist, - get_playlist: qq_get_playlist, + get_playlist: get_playlist, bootstrap_track: qq_bootstrap_track, search: qq_search, - album: qq_album, - artist: qq_artist, lyric: qq_lyric, }; diff --git a/js/xiami.js b/js/xiami.js index a0be678..1ca8522 100644 --- a/js/xiami.js +++ b/js/xiami.js @@ -46,14 +46,14 @@ var xiami = (function() { var default_playlist = { 'cover_img_url' : '', 'title': '', - 'list_id': '', + 'id': '', 'source_url': '' }; default_playlist.cover_img_url = $(this).find('img')[0].src; default_playlist.title = $(this).find('h3 a')[0].title; var xiami_url = $(this).find('h3 a')[0].href; var list_id = xiami_url.split('?')[0].split('/').pop() - default_playlist.list_id = 'xmplaylist_' + list_id; + default_playlist.id = 'xmplaylist_' + list_id; default_playlist.source_url = 'http://www.xiami.com/collect/' + list_id; result.push(default_playlist); }); @@ -63,7 +63,7 @@ var xiami = (function() { }; } - var xm_get_playlist = function(url, hm) { + var xm_get_playlist = function(url, hm, se) { var list_id = getParameterByName('list_id', url).split('_').pop(); return { @@ -101,6 +101,10 @@ var xiami = (function() { var target_url = 'http://www.xiami.com/song/playlist/id/' + track.id.slice('xmtrack_'.length) + '/object_name/default/object_id/0/cat/json'; hm.get(target_url).success(function(data) { + if (data.data.trackList == null) { + failure(); + return; + } var location = data.data.trackList[0].location; sound.url = caesar(location); track.img_url = data.data.trackList[0].pic; @@ -155,7 +159,7 @@ var xiami = (function() { var xm_album = function(url, hm, se) { return { success: function(fn) { - var album_id = getParameterByName('album_id', url).split('_').pop(); + var album_id = getParameterByName('list_id', url).split('_').pop(); var target_url = 'http://api.xiami.com/web?v=2.0&app_key=1&id=' + album_id + '&page=1&limit=20&callback=jsonp217&r=album/detail'; hm({ @@ -188,7 +192,7 @@ var xiami = (function() { var xm_artist = function (url, hm, se) { return { success: function(fn) { - var artist_id = getParameterByName('artist_id', url).split('_').pop(); + var artist_id = getParameterByName('list_id', url).split('_').pop(); var target_url = 'http://api.xiami.com/web?v=2.0&app_key=1&id=' + artist_id + '&page=1&limit=20&_ksTS=1459931285956_216' + @@ -224,6 +228,7 @@ var xiami = (function() { var tracks = []; $.each(data.data, function(index, item){ var track = xm_convert_song(item, 'singers'); + track.artist_id = 'xmartist_' + artist_id; tracks.push(track); }); return fn({"tracks":tracks,"info": info}); @@ -249,13 +254,23 @@ var xiami = (function() { }; } +var get_playlist = function(url, hm, se) { + var list_id = getParameterByName('list_id', url).split('_')[0]; + if (list_id == 'xmplaylist') { + return xm_get_playlist(url, hm, se); + } + if (list_id == 'xmalbum') { + return xm_album(url, hm, se); + } + if (list_id == 'xmartist') { + return xm_artist(url, hm, se); + } +} return { show_playlist: xm_show_playlist, - get_playlist: xm_get_playlist, + get_playlist: get_playlist, bootstrap_track: xm_bootstrap_track, search: xm_search, - album: xm_album, - artist: xm_artist, lyric: xm_lyric, }; diff --git a/listen1.html b/listen1.html index 04c2b8f..d5dee6e 100644 --- a/listen1.html +++ b/listen1.html @@ -26,7 +26,8 @@ - + + @@ -35,29 +36,29 @@ - +
- + - +
- +
+
+ + +
+
+ + +
+ + + + +
+ - --> +
- -

Listen 1

+ +

Listen 1

@@ -138,9 +157,9 @@
  • - +
    - +

    @@ -172,13 +191,16 @@

  • @@ -227,21 +249,25 @@

    {{ playlist_title }}

    播放 添加到当前播放 + 收藏 + 编辑 原始链接 - @@ -263,7 +289,7 @@
    - +
    @@ -271,7 +297,7 @@ {{currentPlaying.title}} - {{ currentPlaying.artist }} + {{ currentPlaying.artist }} @@ -293,7 +319,7 @@
    - + 添加到歌单
    @@ -319,7 +345,7 @@
  • -
    {{ song.artist }}
    +
    {{ song.artist }}