apple_music_library 0.8.0 → 0.9.0
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/CHANGELOG.md +4 -0
- data/Gemfile.lock +1 -1
- data/README.md +8 -2
- data/lib/apple_music_library/artist.rb +4 -0
- data/lib/apple_music_library/track_collection.rb +4 -0
- data/lib/apple_music_library/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d57d33d85a24895e93ca386313d43fe9dd28c6a48bec21fbb4348ec3b168a177
|
4
|
+
data.tar.gz: d3d0b25dbd54fa23f03cea03b46729224d9b1054da276060a62cac40ab0016e3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 319fb967951a32d12f0d871c32d40b56a2c4d674bbb8966de6bf6b592da5b5ed0af41f9443caf2b7b222345ded89264af85bdf75694856a8ed7e37162ab706f1
|
7
|
+
data.tar.gz: 148f0638affc3d19f1c96619e732280966574885fce0c66acc69e083d0cd569200e2a8535f75f96e8ef06b75fdee07b6f0ca82befd0ab8a4bcf914b86af2fff5
|
data/CHANGELOG.md
CHANGED
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -44,10 +44,15 @@ playlist.tracks.each do |track|
|
|
44
44
|
puts track.name
|
45
45
|
end
|
46
46
|
|
47
|
-
# Count tracks by artist
|
47
|
+
# Count tracks by an artist
|
48
48
|
artist = library.artist('XTC')
|
49
49
|
puts artist.tracks.count
|
50
50
|
|
51
|
+
# List genres associated with the artist
|
52
|
+
artist.genres.each do |genre|
|
53
|
+
puts genre.name
|
54
|
+
end
|
55
|
+
|
51
56
|
# Get favorite tracks by this artist
|
52
57
|
favorite_tracks = artist.tracks.select{|t| t.loved? || t.star_rating > 3}
|
53
58
|
|
@@ -68,8 +73,9 @@ end
|
|
68
73
|
|
69
74
|
# Display track counts per genre
|
70
75
|
library.genres.each do |genre|
|
71
|
-
puts "#{genre.
|
76
|
+
puts "#{genre.track_count} #{genre.name}"
|
72
77
|
end
|
78
|
+
|
73
79
|
```
|
74
80
|
All stored attributes are available via snake_cased methods on `Track` and `Playlist`. However, note that `#artist`, `#album`, and `#genre` are special cases, returning Ruby objects rather than their associated string values. Methods to return the string versions of these track attributes are provided as `track.artist_name`, `track.album_name`, and `track.genre_name`.
|
75
81
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: apple_music_library
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.9.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Todd Gehman
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-03-
|
11
|
+
date: 2022-03-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: awesome_print
|
@@ -157,7 +157,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
157
157
|
- !ruby/object:Gem::Version
|
158
158
|
version: '0'
|
159
159
|
requirements: []
|
160
|
-
rubygems_version: 3.3.
|
160
|
+
rubygems_version: 3.3.9
|
161
161
|
signing_key:
|
162
162
|
specification_version: 4
|
163
163
|
summary: Provides a Ruby interface to the information stored in an Apple Music (formerly
|