node watch添加playlist相关统计
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
INSERT INTO analysis (`key`, `value`) VALUES ('songCount', (SELECT count(*) as count FROM song) ) ON DUPLICATE KEY UPDATE `value` = VALUES(`value`);
|
INSERT INTO analysis (`key`, `value`) VALUES ('songCount', (SELECT count(*) as count FROM song) ) ON DUPLICATE KEY UPDATE `value` = VALUES(`value`);
|
||||||
INSERT INTO analysis (`key`, `value`) VALUES ('songWaiting', (SELECT count(DISTINCT song_id) AS count
|
INSERT INTO analysis (`key`, `value`) VALUES ('songWaiting', (SELECT count(DISTINCT song_id) AS count
|
||||||
|
INSERT INTO analysis (`key`, `value`) VALUES ('playlistCount', (SELECT count(*) AS count FROM playlist) ) ON DUPLICATE KEY UPDATE `value` = VALUES(`value`);
|
||||||
FROM ( SELECT song_id FROM song_artist_relation UNION SELECT song_id FROM song_album_relation ) t_tmp
|
FROM ( SELECT song_id FROM song_artist_relation UNION SELECT song_id FROM song_album_relation ) t_tmp
|
||||||
WHERE song_id NOT IN ( SELECT song_id FROM song )) ) ON DUPLICATE KEY UPDATE `value` = VALUES(`value`);
|
WHERE song_id NOT IN ( SELECT song_id FROM song )) ) ON DUPLICATE KEY UPDATE `value` = VALUES(`value`);
|
||||||
INSERT INTO analysis (`key`, `value`) VALUES ('albumCount', (SELECT count(*) as count FROM album) ) ON DUPLICATE KEY UPDATE `value` = VALUES(`value`);
|
INSERT INTO analysis (`key`, `value`) VALUES ('albumCount', (SELECT count(*) as count FROM album) ) ON DUPLICATE KEY UPDATE `value` = VALUES(`value`);
|
||||||
@@ -10,6 +11,7 @@ INSERT INTO analysis (`key`, `value`) VALUES ('lyricCount', (SELECT count(*) AS
|
|||||||
INSERT INTO analysis (`key`, `value`) VALUES ('commentCount', (SELECT count( DISTINCT song_id ) AS count FROM comment) ) ON DUPLICATE KEY UPDATE `value` = VALUES(`value`);
|
INSERT INTO analysis (`key`, `value`) VALUES ('commentCount', (SELECT count( DISTINCT song_id ) AS count FROM comment) ) ON DUPLICATE KEY UPDATE `value` = VALUES(`value`);
|
||||||
INSERT INTO analysis (`key`, `value`) VALUES ('commentTotalCount', (SELECT count(*) AS count FROM comment) ) ON DUPLICATE KEY UPDATE `value` = VALUES(`value`);
|
INSERT INTO analysis (`key`, `value`) VALUES ('commentTotalCount', (SELECT count(*) AS count FROM comment) ) ON DUPLICATE KEY UPDATE `value` = VALUES(`value`);
|
||||||
INSERT INTO analysis (`key`, `value`) VALUES ('userCount', (SELECT count(*) AS count FROM user) ) ON DUPLICATE KEY UPDATE `value` = VALUES(`value`);
|
INSERT INTO analysis (`key`, `value`) VALUES ('userCount', (SELECT count(*) AS count FROM user) ) ON DUPLICATE KEY UPDATE `value` = VALUES(`value`);
|
||||||
|
INSERT INTO analysis (`key`, `value`) VALUES ('songPlaylistCount', (SELECT count(*) AS count FROM song_playlist_relation) ) ON DUPLICATE KEY UPDATE `value` = VALUES(`value`);
|
||||||
INSERT INTO analysis (`key`, `value`) VALUES ('songAlbumCount', (SELECT count(*) AS count FROM song_album_relation) ) ON DUPLICATE KEY UPDATE `value` = VALUES(`value`);
|
INSERT INTO analysis (`key`, `value`) VALUES ('songAlbumCount', (SELECT count(*) AS count FROM song_album_relation) ) ON DUPLICATE KEY UPDATE `value` = VALUES(`value`);
|
||||||
INSERT INTO analysis (`key`, `value`) VALUES ('songArtistCount', (SELECT count(*) AS count FROM song_artist_relation) ) ON DUPLICATE KEY UPDATE `value` = VALUES(`value`);
|
INSERT INTO analysis (`key`, `value`) VALUES ('songArtistCount', (SELECT count(*) AS count FROM song_artist_relation) ) ON DUPLICATE KEY UPDATE `value` = VALUES(`value`);
|
||||||
|
|
||||||
|
@@ -106,6 +106,9 @@ async function watch() {
|
|||||||
sql: `SELECT count(DISTINCT song_id) AS count
|
sql: `SELECT count(DISTINCT song_id) AS count
|
||||||
FROM ( SELECT song_id FROM song_artist_relation UNION SELECT song_id FROM song_album_relation ) t_tmp
|
FROM ( SELECT song_id FROM song_artist_relation UNION SELECT song_id FROM song_album_relation ) t_tmp
|
||||||
WHERE song_id NOT IN ( SELECT song_id FROM song )`,
|
WHERE song_id NOT IN ( SELECT song_id FROM song )`,
|
||||||
|
}, {
|
||||||
|
name: "playlistCount",
|
||||||
|
sql: `SELECT count(*) AS count FROM playlist`,
|
||||||
}, {
|
}, {
|
||||||
name: "albumCount",
|
name: "albumCount",
|
||||||
sql: `SELECT count(*) AS count FROM album`,
|
sql: `SELECT count(*) AS count FROM album`,
|
||||||
@@ -130,6 +133,9 @@ async function watch() {
|
|||||||
}, {
|
}, {
|
||||||
name: "userCount",
|
name: "userCount",
|
||||||
sql: `SELECT count(*) AS count FROM user`,
|
sql: `SELECT count(*) AS count FROM user`,
|
||||||
|
}, {
|
||||||
|
name: "songPlaylistCount",
|
||||||
|
sql: `SELECT count(*) AS count FROM song_playlist_relation`,
|
||||||
}, {
|
}, {
|
||||||
name: "songAlbumCount",
|
name: "songAlbumCount",
|
||||||
sql: `SELECT count(*) AS count FROM song_album_relation`,
|
sql: `SELECT count(*) AS count FROM song_album_relation`,
|
||||||
@@ -170,6 +176,7 @@ async function watch() {
|
|||||||
`[与上次运行统计时相比]`,
|
`[与上次运行统计时相比]`,
|
||||||
[
|
[
|
||||||
`song: ${newWatchParam['songCount'] - oldWatchParam['songCount']}`,
|
`song: ${newWatchParam['songCount'] - oldWatchParam['songCount']}`,
|
||||||
|
`playlist: ${newWatchParam['playlistCount'] - oldWatchParam['playlistCount']}`,
|
||||||
`album: ${newWatchParam['albumCount'] - oldWatchParam['albumCount']}`,
|
`album: ${newWatchParam['albumCount'] - oldWatchParam['albumCount']}`,
|
||||||
`artist: ${newWatchParam['artistCount'] - oldWatchParam['artistCount']}`,
|
`artist: ${newWatchParam['artistCount'] - oldWatchParam['artistCount']}`,
|
||||||
`lyric: ${newWatchParam['lyricCount'] - oldWatchParam['lyricCount']}`,
|
`lyric: ${newWatchParam['lyricCount'] - oldWatchParam['lyricCount']}`,
|
||||||
@@ -179,6 +186,7 @@ async function watch() {
|
|||||||
`[已爬取]`,
|
`[已爬取]`,
|
||||||
[
|
[
|
||||||
`song: ${newWatchParam['songCount']}`,
|
`song: ${newWatchParam['songCount']}`,
|
||||||
|
`playlist: ${newWatchParam['playlistCount']}`,
|
||||||
`album: ${newWatchParam['albumCount']}`,
|
`album: ${newWatchParam['albumCount']}`,
|
||||||
`artist: ${newWatchParam['artistCount']}`,
|
`artist: ${newWatchParam['artistCount']}`,
|
||||||
`lyric: ${newWatchParam['lyricCount']}`,
|
`lyric: ${newWatchParam['lyricCount']}`,
|
||||||
@@ -188,6 +196,7 @@ async function watch() {
|
|||||||
`[待爬取]`,
|
`[待爬取]`,
|
||||||
[
|
[
|
||||||
`song: ${newWatchParam['songWaiting']}`,
|
`song: ${newWatchParam['songWaiting']}`,
|
||||||
|
`playlist: 未知`,
|
||||||
`album: ${newWatchParam['albumWaiting']}`,
|
`album: ${newWatchParam['albumWaiting']}`,
|
||||||
`artist: ${newWatchParam['artistWaiting']}`,
|
`artist: ${newWatchParam['artistWaiting']}`,
|
||||||
`lyric: ${newWatchParam['songCount'] - newWatchParam['lyricCount']}`,
|
`lyric: ${newWatchParam['songCount'] - newWatchParam['lyricCount']}`,
|
||||||
@@ -197,6 +206,7 @@ async function watch() {
|
|||||||
`[总计] (已爬取 + 待爬取)`,
|
`[总计] (已爬取 + 待爬取)`,
|
||||||
[
|
[
|
||||||
`song: ${newWatchParam['songCount'] + newWatchParam['songWaiting']}`,
|
`song: ${newWatchParam['songCount'] + newWatchParam['songWaiting']}`,
|
||||||
|
`playlist: ${newWatchParam['playlistCount']}`,
|
||||||
`album: ${newWatchParam['albumCount'] + newWatchParam['albumWaiting']}`,
|
`album: ${newWatchParam['albumCount'] + newWatchParam['albumWaiting']}`,
|
||||||
`artist: ${newWatchParam['artistCount'] + newWatchParam['artistWaiting']}`,
|
`artist: ${newWatchParam['artistCount'] + newWatchParam['artistWaiting']}`,
|
||||||
`lyric: ${newWatchParam['songCount']}`,
|
`lyric: ${newWatchParam['songCount']}`,
|
||||||
@@ -204,7 +214,7 @@ async function watch() {
|
|||||||
`user: ${newWatchParam['userCount']}`,
|
`user: ${newWatchParam['userCount']}`,
|
||||||
].join(', '),
|
].join(', '),
|
||||||
`[关联关系统计]`,
|
`[关联关系统计]`,
|
||||||
`song-album: ${newWatchParam['songAlbumCount']}, song-artist: ${newWatchParam['songArtistCount']}`,
|
`song-playlist: ${newWatchParam['songPlaylistCount']}, song-album: ${newWatchParam['songAlbumCount']}, song-artist: ${newWatchParam['songArtistCount']}`,
|
||||||
``
|
``
|
||||||
].join('\n');
|
].join('\n');
|
||||||
console.log(statisticsString);
|
console.log(statisticsString);
|
||||||
|
Reference in New Issue
Block a user