apple_music_library 0.12.0 → 0.13.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 +1 -0
- data/lib/apple_music_library/playlist.rb +28 -11
- data/lib/apple_music_library/version.rb +1 -1
- 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: 8a7c56a173f838819c8b5e9fe672030b2d592571367e4d98ea5898deff6b26c1
|
|
4
|
+
data.tar.gz: 0c7941388118cb202ff0e1d0483f0bc5d0241380ed5ba816db6f838aa01d8a33
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 1780aa02d02a2511d3c5147e25366a0b2075fd65d0bbb7a8afd516adc29321aa9ea13ded93528f6e63d9e90b10bf060ecc87a644eee408bc69de2cab579c26f4
|
|
7
|
+
data.tar.gz: eedebe0a903e4c46554589b2e6ab8a418032186ee83f87346b31797883624e81279460dfc703eb81320eba4bc1ef5c256f28382f68d95312aa08cd32d438285b
|
data/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,10 @@
|
|
|
3
3
|
## [Unreleased]
|
|
4
4
|
- Ability to print out playlist folder hierarchy
|
|
5
5
|
|
|
6
|
+
## 0.13.0 - 2022-03-26
|
|
7
|
+
### Added
|
|
8
|
+
- Added handling for system verses user-created playlists
|
|
9
|
+
|
|
6
10
|
## 0.12.0 - 2022-03-26
|
|
7
11
|
### Added
|
|
8
12
|
- Added handling for smart versus regular playlists
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
|
@@ -49,6 +49,7 @@ library.playlists(:smart).each do |playlist|
|
|
|
49
49
|
end
|
|
50
50
|
|
|
51
51
|
# List all regular (not 'smart') playlists
|
|
52
|
+
# This filter also excludes apple-created playlists (e.g. the 'Library' and 'Downloaded' playlists)
|
|
52
53
|
library.playlists(:regular).each do |playlist|
|
|
53
54
|
puts playlist.name
|
|
54
55
|
end
|
|
@@ -8,16 +8,25 @@ module AppleMusicLibrary
|
|
|
8
8
|
|
|
9
9
|
@@playlists = {}
|
|
10
10
|
|
|
11
|
-
ATTRIBUTES = [
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
11
|
+
ATTRIBUTES = [
|
|
12
|
+
'Name',
|
|
13
|
+
'Description',
|
|
14
|
+
'Playlist ID',
|
|
15
|
+
'Playlist Persistent ID',
|
|
16
|
+
'Parent Persistent ID',
|
|
17
|
+
'All Items',
|
|
18
|
+
'Smart Info',
|
|
19
|
+
'Smart Criteria',
|
|
20
|
+
'Playlist Items',
|
|
21
|
+
'Folder'
|
|
22
|
+
]
|
|
23
|
+
|
|
24
|
+
SYSTEM_PLAYLISTS = [
|
|
25
|
+
'Downloaded',
|
|
26
|
+
'Library',
|
|
27
|
+
'Music',
|
|
28
|
+
'Recently Played'
|
|
29
|
+
]
|
|
21
30
|
|
|
22
31
|
def initialize(info)
|
|
23
32
|
@info = info
|
|
@@ -42,7 +51,11 @@ module AppleMusicLibrary
|
|
|
42
51
|
end
|
|
43
52
|
|
|
44
53
|
def self.regular
|
|
45
|
-
@@playlists.values.select{|p| !p.smart?}
|
|
54
|
+
@@playlists.values.select{|p| !p.smart? and !p.system?}
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
def self.system
|
|
58
|
+
@@playlists.values.select{|p| p.system?}
|
|
46
59
|
end
|
|
47
60
|
|
|
48
61
|
def self.find_by_name(playlist_name)
|
|
@@ -71,6 +84,10 @@ module AppleMusicLibrary
|
|
|
71
84
|
smart_info.present?
|
|
72
85
|
end
|
|
73
86
|
|
|
87
|
+
def system?
|
|
88
|
+
SYSTEM_PLAYLISTS.include?(name)
|
|
89
|
+
end
|
|
90
|
+
|
|
74
91
|
def token
|
|
75
92
|
:playlist
|
|
76
93
|
end
|