node watch添加playlist相关统计
This commit is contained in:
		@@ -106,6 +106,9 @@ async function watch() {
 | 
			
		||||
            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
 | 
			
		||||
                WHERE song_id NOT IN ( SELECT song_id FROM song )`,
 | 
			
		||||
        }, {
 | 
			
		||||
            name: "playlistCount",
 | 
			
		||||
            sql: `SELECT count(*) AS count FROM playlist`,
 | 
			
		||||
        }, {
 | 
			
		||||
            name: "albumCount",
 | 
			
		||||
            sql: `SELECT count(*) AS count FROM album`,
 | 
			
		||||
@@ -130,6 +133,9 @@ async function watch() {
 | 
			
		||||
        }, {
 | 
			
		||||
            name: "userCount",
 | 
			
		||||
            sql: `SELECT count(*) AS count FROM user`,
 | 
			
		||||
        }, {
 | 
			
		||||
            name: "songPlaylistCount",
 | 
			
		||||
            sql: `SELECT count(*) AS count FROM song_playlist_relation`,
 | 
			
		||||
        }, {
 | 
			
		||||
            name: "songAlbumCount",
 | 
			
		||||
            sql: `SELECT count(*) AS count FROM song_album_relation`,
 | 
			
		||||
@@ -170,6 +176,7 @@ async function watch() {
 | 
			
		||||
        `[与上次运行统计时相比]`,
 | 
			
		||||
        [
 | 
			
		||||
            `song: ${newWatchParam['songCount'] - oldWatchParam['songCount']}`,
 | 
			
		||||
            `playlist: ${newWatchParam['playlistCount'] - oldWatchParam['playlistCount']}`,
 | 
			
		||||
            `album: ${newWatchParam['albumCount'] - oldWatchParam['albumCount']}`,
 | 
			
		||||
            `artist: ${newWatchParam['artistCount'] - oldWatchParam['artistCount']}`,
 | 
			
		||||
            `lyric: ${newWatchParam['lyricCount'] - oldWatchParam['lyricCount']}`,
 | 
			
		||||
@@ -179,6 +186,7 @@ async function watch() {
 | 
			
		||||
        `[已爬取]`,
 | 
			
		||||
        [
 | 
			
		||||
            `song: ${newWatchParam['songCount']}`,
 | 
			
		||||
            `playlist: ${newWatchParam['playlistCount']}`,
 | 
			
		||||
            `album: ${newWatchParam['albumCount']}`,
 | 
			
		||||
            `artist: ${newWatchParam['artistCount']}`,
 | 
			
		||||
            `lyric: ${newWatchParam['lyricCount']}`,
 | 
			
		||||
@@ -188,6 +196,7 @@ async function watch() {
 | 
			
		||||
        `[待爬取]`,
 | 
			
		||||
        [
 | 
			
		||||
            `song: ${newWatchParam['songWaiting']}`,
 | 
			
		||||
            `playlist: 未知`,
 | 
			
		||||
            `album: ${newWatchParam['albumWaiting']}`,
 | 
			
		||||
            `artist: ${newWatchParam['artistWaiting']}`,
 | 
			
		||||
            `lyric: ${newWatchParam['songCount'] - newWatchParam['lyricCount']}`,
 | 
			
		||||
@@ -197,6 +206,7 @@ async function watch() {
 | 
			
		||||
        `[总计] (已爬取 + 待爬取)`,
 | 
			
		||||
        [
 | 
			
		||||
            `song: ${newWatchParam['songCount'] + newWatchParam['songWaiting']}`,
 | 
			
		||||
            `playlist: ${newWatchParam['playlistCount']}`,
 | 
			
		||||
            `album: ${newWatchParam['albumCount'] + newWatchParam['albumWaiting']}`,
 | 
			
		||||
            `artist: ${newWatchParam['artistCount'] + newWatchParam['artistWaiting']}`,
 | 
			
		||||
            `lyric: ${newWatchParam['songCount']}`,
 | 
			
		||||
@@ -204,7 +214,7 @@ async function watch() {
 | 
			
		||||
            `user: ${newWatchParam['userCount']}`,
 | 
			
		||||
        ].join(', '),
 | 
			
		||||
        `[关联关系统计]`,
 | 
			
		||||
        `song-album: ${newWatchParam['songAlbumCount']}, song-artist: ${newWatchParam['songArtistCount']}`,
 | 
			
		||||
        `song-playlist: ${newWatchParam['songPlaylistCount']}, song-album: ${newWatchParam['songAlbumCount']}, song-artist: ${newWatchParam['songArtistCount']}`,
 | 
			
		||||
        ``
 | 
			
		||||
    ].join('\n');
 | 
			
		||||
    console.log(statisticsString);
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user