spotify_rec 1.0 → 1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/rec.rb +12 -3
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9daf63ceb4fca531e3c229176858b08e361a967f5e4659e8e4148986ea674f9b
|
4
|
+
data.tar.gz: 74a1726add037202ce570f14395ea81938883c1fee44d322a26668dccb6effe1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3646d4d9de7e2af452e6b63d73beb92018855ae502fc5cfbc7dd27de11c8887a2f4a83001430166a92d540ea548b8b348fbf89f595a22a0674afac01812a94f0
|
7
|
+
data.tar.gz: b1d72a64347e2670f80b46284e4b1426f089d2f6311a24fa1a41dc71c718a0bcb6f5f50e3110d9fba0687ba366a79e6df6352c36f38c267aab94f71a92bd443e
|
data/lib/rec.rb
CHANGED
@@ -3,12 +3,15 @@ class Rec
|
|
3
3
|
def initialize(user)
|
4
4
|
@user_list = user.mylist
|
5
5
|
@user = user
|
6
|
-
end
|
7
|
-
|
8
|
-
def sort_my_list
|
9
6
|
@tracks = []
|
10
7
|
@artists = []
|
11
8
|
@genres = []
|
9
|
+
end
|
10
|
+
|
11
|
+
def sort_my_list
|
12
|
+
@tracks.clear
|
13
|
+
@artists.clear
|
14
|
+
@genres.clear
|
12
15
|
@user_list.each do |item|
|
13
16
|
@tracks << item["id"] if item["type"] == "track"
|
14
17
|
@artists << item["id"] if item["type"] == "artist"
|
@@ -53,6 +56,12 @@ class Rec
|
|
53
56
|
|
54
57
|
def amount_of_suggestions
|
55
58
|
system("clear")
|
59
|
+
if @user_list.length <= 0
|
60
|
+
puts "Uh oh! You don't have any items in your list yet, so we can't generate any recommendations. Please add some before doing this!".colorize(:light_red)
|
61
|
+
$prompt.keypress("Press any key to return to the previous menu..")
|
62
|
+
menu = Menu.new(@user)
|
63
|
+
menu.display_menu
|
64
|
+
end
|
56
65
|
puts "》 RECOMMENDATIONS 《"
|
57
66
|
amount = $prompt.ask("How many recommendations would you like to generate?".colorize(:light_green)) do |q|
|
58
67
|
q.in '1-10'
|