11// Документация: https://chimildic.github.io/goofy/
2- const VERSION = '1.4.5 ' ;
2+ const VERSION = '1.4.6 ' ;
33const UserProperties = PropertiesService . getUserProperties ( ) ;
44const KeyValue = UserProperties . getProperties ( ) ;
55const API_BASE_URL = 'https://api.spotify.com/v1' ;
@@ -566,7 +566,8 @@ const RecentTracks = (function () {
566566 }
567567
568568 return {
569- get : get ,
569+ getPlayingTrack : getPlayingTrack ,
570+ get : getRecentTracks ,
570571 update : update ,
571572 compress : compress ,
572573 appendTracks : appendTracks ,
@@ -592,7 +593,12 @@ const RecentTracks = (function () {
592593 }
593594 }
594595
595- function get ( limit ) {
596+ function getPlayingTrack ( ) {
597+ let url = `${ API_BASE_URL } /me/player/currently-playing` ;
598+ return SpotifyRequest . get ( url ) . item || { } ;
599+ }
600+
601+ function getRecentTracks ( limit ) {
596602 let tracks = [ ] ;
597603 if ( ON_SPOTIFY_RECENT_TRACKS && ON_LASTFM_RECENT_TRACKS ) {
598604 tracks = readValidArray ( BOTH_SOURCE_FILENAME ) ;
@@ -2719,6 +2725,7 @@ const Auth = (function () {
27192725 'user-library-read' ,
27202726 'user-library-modify' ,
27212727 'user-read-recently-played' ,
2728+ 'user-read-currently-playing' ,
27222729 'user-top-read' ,
27232730 'user-follow-read' ,
27242731 'user-follow-modify' ,
@@ -2991,12 +2998,13 @@ const Admin = (function () {
29912998 } ;
29922999
29933000 function sendVersion ( value ) {
2994- let id = '1FAIpQLSfvxL6pMLbdUbefFSvEMfXkRPm_maKVbHX2H2jhDUpLHi8Lfw ' ;
3001+ let id = '1FAIpQLSeSe9Jgw5Ml1XxTlz1HHnyHGoFcA65CabbAAJcvk5elXL2gZw ' ;
29953002 CustomUrlFetchApp . fetch ( `https://docs.google.com/forms/u/0/d/e/${ id } /formResponse` , {
29963003 method : 'post' ,
29973004 payload : {
29983005 'entry.1598003363' : value ,
29993006 'entry.1594601658' : ScriptApp . getScriptId ( ) ,
3007+ 'entry.1666409024' : User . getId ( ) ,
30003008 } ,
30013009 } ) ;
30023010 }
0 commit comments