commit 93d6735f902c01ec95fe678befd62142fe5e7c71
parent 30c19bd6cf8c71106da1756d327904bb3d0c2215
Author: Alex Balgavy <alex@balgavy.eu>
Date: Sun, 23 Jun 2024 23:54:22 +0200
libspotify: cache file update
Diffstat:
2 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/scripts/libspotify.rb b/scripts/libspotify.rb
@@ -64,6 +64,7 @@ class SpotifyClient
end
t = Thread.new { server.start }
+ puts "If it doesn't open automatically, open this in your browser:\n#{url}"
system 'open', url
t.join
end
@@ -159,7 +160,7 @@ class SpotifyClient
print "\n"
puts 'Sorting'
- releases.sort_by { |rel| rel.release_date }
+ releases.sort_by(&:release_date)
end
def add_to_playlist_if_not_present(playlist_id, tracks)
@@ -194,9 +195,9 @@ def process_new_releases
acc + client.api_call_get_unpaginate("albums/#{album.id}/tracks", { limit: 50 })
end
- puts "Processing tracks"
+ puts 'Processing tracks'
client.add_to_playlist_if_not_present tracks_playlist, others_tracks
- puts "Processing albums"
+ puts 'Processing albums'
client.add_to_playlist_if_not_present albums_playlist, albums_tracks
File.write("#{ENV['HOME']}/.local/share/spot-last-checked", YAML.dump(Date.today))
end
diff --git a/spotify/spot-last-checked b/spotify/spot-last-checked
@@ -0,0 +1 @@
+--- 2024-06-23