musicbrainz 0.7.7 → 0.8.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (57) hide show
  1. checksums.yaml +7 -0
  2. data/.github/workflows/test.yml +26 -0
  3. data/.gitignore +2 -2
  4. data/Gemfile +11 -0
  5. data/Gemfile.lock +54 -0
  6. data/LICENSE +2 -2
  7. data/README.md +21 -10
  8. data/lib/musicbrainz/bindings/artist.rb +0 -1
  9. data/lib/musicbrainz/bindings/artist_search.rb +0 -1
  10. data/lib/musicbrainz/bindings/discid_releases.rb +13 -0
  11. data/lib/musicbrainz/bindings/recording.rb +19 -0
  12. data/lib/musicbrainz/bindings/{track_search.rb → recording_search.rb} +1 -2
  13. data/lib/musicbrainz/bindings/relations.rb +1 -2
  14. data/lib/musicbrainz/bindings/release_group_search.rb +0 -1
  15. data/lib/musicbrainz/client_modules/caching_proxy.rb +27 -13
  16. data/lib/musicbrainz/models/base_model.rb +12 -2
  17. data/lib/musicbrainz/models/recording.rb +20 -0
  18. data/lib/musicbrainz/models/release.rb +8 -1
  19. data/lib/musicbrainz/models/track.rb +0 -4
  20. data/lib/musicbrainz/version.rb +1 -1
  21. data/lib/musicbrainz.rb +4 -1
  22. data/musicbrainz.gemspec +3 -6
  23. data/spec/bindings/recording_search_spec.rb +48 -0
  24. data/spec/bindings/relations_spec.rb +45 -26
  25. data/spec/bindings/release_group_search_spec.rb +24 -6
  26. data/spec/bindings/release_spec.rb +94 -18
  27. data/spec/client_modules/cache_spec.rb +18 -17
  28. data/spec/deprecated/cache_config_spec.rb +4 -6
  29. data/spec/deprecated/proxy_config_spec.rb +4 -6
  30. data/spec/fixtures/artist/find_69b39eab-6577-46a4-a9f5-817839092033.xml +168 -0
  31. data/spec/fixtures/artist/release_groups_69b39eab-6577-46a4-a9f5-817839092033.xml +412 -0
  32. data/spec/fixtures/artist/search_kasabian.xml +104 -0
  33. data/spec/fixtures/recording/find_b3015bab-1540-4d4e-9f30-14872a1525f7.xml +8 -0
  34. data/spec/fixtures/recording/search_bound_for_the_floor_local_h.xml +647 -0
  35. data/spec/fixtures/release/find_2225dd4c-ae9a-403b-8ea0-9e05014c778f.xml +44 -0
  36. data/spec/fixtures/release/find_2225dd4c-ae9a-403b-8ea0-9e05014c778f_tracks.xml +151 -0
  37. data/spec/fixtures/release/find_b94cb547-cf7a-4357-894c-53c3bf33b093.xml +52 -0
  38. data/spec/fixtures/release/find_by_discid_pmzhT6ZlFiwSRCdVwV0eqire5_Y-.xml +141 -0
  39. data/spec/fixtures/release/list_6f33e0f0-cde2-38f9-9aee-2c60af8d1a61.xml +344 -0
  40. data/spec/fixtures/release_group/search_kasabian_empire_album.xml +117 -0
  41. data/spec/models/artist_spec.rb +77 -46
  42. data/spec/models/base_model_spec.rb +50 -22
  43. data/spec/models/recording_spec.rb +42 -0
  44. data/spec/models/release_group_spec.rb +61 -55
  45. data/spec/models/release_spec.rb +63 -28
  46. data/spec/models/track_spec.rb +19 -15
  47. data/spec/spec_helper.rb +7 -7
  48. data/spec/support/mock_helpers.rb +13 -0
  49. metadata +55 -93
  50. data/.rspec +0 -1
  51. data/.travis.yml +0 -4
  52. data/spec/bindings/track_search_spec.rb +0 -17
  53. data/spec/fixtures/artist/search.xml +0 -67
  54. data/spec/fixtures/kasabian.xml +0 -1
  55. data/spec/fixtures/release/list.xml +0 -344
  56. /data/spec/fixtures/release_group/{entity.xml → find_6f33e0f0-cde2-38f9-9aee-2c60af8d1a61.xml} +0 -0
  57. /data/spec/fixtures/release_group/{search.xml → search_kasabian_empire.xml} +0 -0
@@ -0,0 +1,44 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <metadata xmlns="http://musicbrainz.org/ns/mmd-2.0#">
3
+ <release id="2225dd4c-ae9a-403b-8ea0-9e05014c778f">
4
+ <title>Empire</title>
5
+ <status id="4e304316-386d-3409-af2e-78857eec5cfe">Official</status>
6
+ <quality>normal</quality>
7
+ <text-representation>
8
+ <language>eng</language>
9
+ <script>Latn</script>
10
+ </text-representation>
11
+ <release-group id="6f33e0f0-cde2-38f9-9aee-2c60af8d1a61" type="Album" type-id="f529b476-6e62-324f-b0aa-1f3e33d313fc">
12
+ <title>Empire</title>
13
+ <first-release-date>2006-08-25</first-release-date>
14
+ <primary-type id="f529b476-6e62-324f-b0aa-1f3e33d313fc">Album</primary-type>
15
+ </release-group>
16
+ <date>2006-08-28</date>
17
+ <country>GB</country>
18
+ <release-event-list count="1">
19
+ <release-event>
20
+ <date>2006-08-28</date>
21
+ <area id="8a754a16-0027-3a29-b6d7-2b40ea0481ed">
22
+ <name>United Kingdom</name>
23
+ <sort-name>United Kingdom</sort-name>
24
+ <iso-3166-1-code-list>
25
+ <iso-3166-1-code>GB</iso-3166-1-code>
26
+ </iso-3166-1-code-list>
27
+ </area>
28
+ </release-event>
29
+ </release-event-list>
30
+ <asin>B000H49P28</asin>
31
+ <cover-art-archive>
32
+ <artwork>true</artwork>
33
+ <count>1</count>
34
+ <front>true</front>
35
+ <back>false</back>
36
+ </cover-art-archive>
37
+ <medium-list count="1">
38
+ <medium>
39
+ <position>1</position>
40
+ <track-list count="11"/>
41
+ </medium>
42
+ </medium-list>
43
+ </release>
44
+ </metadata>
@@ -0,0 +1,151 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <metadata xmlns="http://musicbrainz.org/ns/mmd-2.0#">
3
+ <release id="2225dd4c-ae9a-403b-8ea0-9e05014c778f">
4
+ <title>Empire</title>
5
+ <status id="4e304316-386d-3409-af2e-78857eec5cfe">Official</status>
6
+ <quality>normal</quality>
7
+ <text-representation>
8
+ <language>eng</language>
9
+ <script>Latn</script>
10
+ </text-representation>
11
+ <date>2006-08-28</date>
12
+ <country>GB</country>
13
+ <release-event-list count="1">
14
+ <release-event>
15
+ <date>2006-08-28</date>
16
+ <area id="8a754a16-0027-3a29-b6d7-2b40ea0481ed">
17
+ <name>United Kingdom</name>
18
+ <sort-name>United Kingdom</sort-name>
19
+ <iso-3166-1-code-list>
20
+ <iso-3166-1-code>GB</iso-3166-1-code>
21
+ </iso-3166-1-code-list>
22
+ </area>
23
+ </release-event>
24
+ </release-event-list>
25
+ <asin>B000H49P28</asin>
26
+ <cover-art-archive>
27
+ <artwork>true</artwork>
28
+ <count>1</count>
29
+ <front>true</front>
30
+ <back>false</back>
31
+ </cover-art-archive>
32
+ <medium-list count="1">
33
+ <medium>
34
+ <position>1</position>
35
+ <track-list count="11" offset="0">
36
+ <track id="0501cf38-48b7-3026-80d2-717d574b3d6a">
37
+ <position>1</position>
38
+ <number>1</number>
39
+ <length>233013</length>
40
+ <recording id="b3015bab-1540-4d4e-9f30-14872a1525f7">
41
+ <title>Empire</title>
42
+ <length>233013</length>
43
+ <first-release-date>2006-08-25</first-release-date>
44
+ </recording>
45
+ </track>
46
+ <track id="0f01dd2f-81c9-3c27-8e1d-c8adf2f518ac">
47
+ <position>2</position>
48
+ <number>2</number>
49
+ <length>207373</length>
50
+ <recording id="43b2f487-0d08-4acc-a090-35ad408986a7">
51
+ <title>Shoot the Runner</title>
52
+ <length>207373</length>
53
+ <disambiguation>album version</disambiguation>
54
+ <first-release-date>2006-08-25</first-release-date>
55
+ </recording>
56
+ </track>
57
+ <track id="13d5eec9-efc5-3a16-9876-7afb1778e47d">
58
+ <position>3</position>
59
+ <number>3</number>
60
+ <length>173160</length>
61
+ <recording id="bec0618e-aa89-4a34-b944-f3f2baea4345">
62
+ <title>Last Trip (In Flight)</title>
63
+ <length>173160</length>
64
+ <first-release-date>2006-08-25</first-release-date>
65
+ </recording>
66
+ </track>
67
+ <track id="da159049-7459-3215-9b13-3742a8db94b7">
68
+ <position>4</position>
69
+ <number>4</number>
70
+ <length>148733</length>
71
+ <recording id="e20d8620-b241-40c4-8e31-b26715261f1b">
72
+ <title>Me Plus One</title>
73
+ <length>148733</length>
74
+ <first-release-date>2006-08-25</first-release-date>
75
+ </recording>
76
+ </track>
77
+ <track id="1218042d-2ab4-3c84-b0d2-0f9c9b1f929c">
78
+ <position>5</position>
79
+ <number>5</number>
80
+ <length>248653</length>
81
+ <recording id="dac22e23-8452-4040-9977-ec1648fa799f">
82
+ <title>Sun Rise Light Flies</title>
83
+ <length>248653</length>
84
+ <first-release-date>2006-08-25</first-release-date>
85
+ </recording>
86
+ </track>
87
+ <track id="52b20e8f-1c38-3225-aeef-f293336534bf">
88
+ <position>6</position>
89
+ <number>6</number>
90
+ <length>107973</length>
91
+ <recording id="36ee03dc-43c1-4ef1-a18e-ebd30ff95d17">
92
+ <title>Apnoea</title>
93
+ <length>107973</length>
94
+ <first-release-date>2006-08-25</first-release-date>
95
+ </recording>
96
+ </track>
97
+ <track id="6bf92b79-6449-3b55-bd64-c5683727493e">
98
+ <position>7</position>
99
+ <number>7</number>
100
+ <length>254373</length>
101
+ <recording id="47ec6792-3c84-48fc-b3a4-f047de6c6405">
102
+ <title>By My Side</title>
103
+ <length>254373</length>
104
+ <first-release-date>2006-08-25</first-release-date>
105
+ </recording>
106
+ </track>
107
+ <track id="862ad1e2-3f35-32e8-a953-484c610b183e">
108
+ <position>8</position>
109
+ <number>8</number>
110
+ <length>319626</length>
111
+ <recording id="66cc6ebf-850d-4ec1-a10e-7ab9db9dae03">
112
+ <title>Stuntman</title>
113
+ <length>319626</length>
114
+ <first-release-date>2006-08-25</first-release-date>
115
+ </recording>
116
+ </track>
117
+ <track id="25bbba97-383c-30ca-9935-69997a90e48e">
118
+ <position>9</position>
119
+ <number>9</number>
120
+ <length>135053</length>
121
+ <recording id="92f5aa84-7752-4c2a-ba79-06d91a8a390d">
122
+ <title>Seek &amp; Destroy</title>
123
+ <length>135053</length>
124
+ <first-release-date>2006-08-25</first-release-date>
125
+ </recording>
126
+ </track>
127
+ <track id="c749962a-53b1-3546-95ec-609c8926e39d">
128
+ <position>10</position>
129
+ <number>10</number>
130
+ <length>199866</length>
131
+ <recording id="7865a614-14ac-478f-8c5d-4991af86c7a7">
132
+ <title>British Legion</title>
133
+ <length>199866</length>
134
+ <first-release-date>2006-08-25</first-release-date>
135
+ </recording>
136
+ </track>
137
+ <track id="044d688d-8b3e-362c-ad6f-6e7c3b239303">
138
+ <position>11</position>
139
+ <number>11</number>
140
+ <length>1156293</length>
141
+ <recording id="04003da8-ba59-48a2-acfc-ef7d5e634bc0">
142
+ <title>The Doberman / [untitled]</title>
143
+ <length>333973</length>
144
+ <first-release-date>2006-08-28</first-release-date>
145
+ </recording>
146
+ </track>
147
+ </track-list>
148
+ </medium>
149
+ </medium-list>
150
+ </release>
151
+ </metadata>
@@ -0,0 +1,52 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <metadata xmlns="http://musicbrainz.org/ns/mmd-2.0#">
3
+ <release id="b94cb547-cf7a-4357-894c-53c3bf33b093">
4
+ <title>Humanoid</title>
5
+ <status id="4e304316-386d-3409-af2e-78857eec5cfe">Official</status>
6
+ <quality>normal</quality>
7
+ <text-representation>
8
+ <language>eng</language>
9
+ <script>Latn</script>
10
+ </text-representation>
11
+ <release-group id="3b8878fe-9beb-471a-8a2f-f36a93a9e48e" type="Album" type-id="f529b476-6e62-324f-b0aa-1f3e33d313fc">
12
+ <title>Humanoid</title>
13
+ <disambiguation>English version</disambiguation>
14
+ <first-release-date>2009-10-02</first-release-date>
15
+ <primary-type id="f529b476-6e62-324f-b0aa-1f3e33d313fc">Album</primary-type>
16
+ </release-group>
17
+ <date>2009-10-06</date>
18
+ <country>US</country>
19
+ <release-event-list count="1">
20
+ <release-event>
21
+ <date>2009-10-06</date>
22
+ <area id="489ce91b-6658-3307-9877-795b68554c98">
23
+ <name>United States</name>
24
+ <sort-name>United States</sort-name>
25
+ <iso-3166-1-code-list>
26
+ <iso-3166-1-code>US</iso-3166-1-code>
27
+ </iso-3166-1-code-list>
28
+ </area>
29
+ </release-event>
30
+ </release-event-list>
31
+ <barcode>602527197692</barcode>
32
+ <asin>B002NOYX6I</asin>
33
+ <cover-art-archive>
34
+ <artwork>false</artwork>
35
+ <count>0</count>
36
+ <front>false</front>
37
+ <back>false</back>
38
+ </cover-art-archive>
39
+ <medium-list count="2">
40
+ <medium>
41
+ <position>1</position>
42
+ <format id="9712d52a-4509-3d4b-a1a2-67c88c643e31">CD</format>
43
+ <track-list count="12"/>
44
+ </medium>
45
+ <medium>
46
+ <position>2</position>
47
+ <format id="9712d52a-4509-3d4b-a1a2-67c88c643e31">CD</format>
48
+ <track-list count="4"/>
49
+ </medium>
50
+ </medium-list>
51
+ </release>
52
+ </metadata>
@@ -0,0 +1,141 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <metadata xmlns="http://musicbrainz.org/ns/mmd-2.0#">
3
+ <disc id="pmzhT6ZlFiwSRCdVwV0eqire5_Y-">
4
+ <sectors>217171</sectors>
5
+ <offset-list count="9">
6
+ <offset position="1">150</offset>
7
+ <offset position="2">35000</offset>
8
+ <offset position="3">63711</offset>
9
+ <offset position="4">86440</offset>
10
+ <offset position="5">105891</offset>
11
+ <offset position="6">128017</offset>
12
+ <offset position="7">154668</offset>
13
+ <offset position="8">177007</offset>
14
+ <offset position="9">200379</offset>
15
+ </offset-list>
16
+ <release-list count="2">
17
+ <release id="7a31cd5f-6a57-4fca-a731-c521df1d3b78">
18
+ <title>Kveikur</title>
19
+ <status id="4e304316-386d-3409-af2e-78857eec5cfe">Official</status>
20
+ <quality>normal</quality>
21
+ <packaging id="f7101ce3-0384-39ce-9fde-fbbd0044d35f">Cardboard/Paper Sleeve</packaging>
22
+ <text-representation>
23
+ <language>isl</language>
24
+ <script>Latn</script>
25
+ </text-representation>
26
+ <date>2013-06-17</date>
27
+ <country>XE</country>
28
+ <release-event-list count="2">
29
+ <release-event>
30
+ <date>2013-06-17</date>
31
+ <area id="89a675c2-3e37-3518-b83c-418bad59a85a">
32
+ <name>Europe</name>
33
+ <sort-name>Europe</sort-name>
34
+ <iso-3166-1-code-list>
35
+ <iso-3166-1-code>XE</iso-3166-1-code>
36
+ </iso-3166-1-code-list>
37
+ </area>
38
+ </release-event>
39
+ <release-event>
40
+ <date>2013-06-18</date>
41
+ <area id="489ce91b-6658-3307-9877-795b68554c98">
42
+ <name>United States</name>
43
+ <sort-name>United States</sort-name>
44
+ <iso-3166-1-code-list>
45
+ <iso-3166-1-code>US</iso-3166-1-code>
46
+ </iso-3166-1-code-list>
47
+ </area>
48
+ </release-event>
49
+ </release-event-list>
50
+ <barcode>634904060626</barcode>
51
+ <asin>B00C1GBOU6</asin>
52
+ <cover-art-archive>
53
+ <artwork>true</artwork>
54
+ <count>14</count>
55
+ <front>true</front>
56
+ <back>true</back>
57
+ </cover-art-archive>
58
+ <medium-list count="1">
59
+ <medium>
60
+ <position>1</position>
61
+ <format id="9712d52a-4509-3d4b-a1a2-67c88c643e31">CD</format>
62
+ <disc-list count="1">
63
+ <disc id="pmzhT6ZlFiwSRCdVwV0eqire5_Y-">
64
+ <sectors>217171</sectors>
65
+ <offset-list count="9">
66
+ <offset position="1">150</offset>
67
+ <offset position="2">35000</offset>
68
+ <offset position="3">63711</offset>
69
+ <offset position="4">86440</offset>
70
+ <offset position="5">105891</offset>
71
+ <offset position="6">128017</offset>
72
+ <offset position="7">154668</offset>
73
+ <offset position="8">177007</offset>
74
+ <offset position="9">200379</offset>
75
+ </offset-list>
76
+ </disc>
77
+ </disc-list>
78
+ <track-list count="9"/>
79
+ </medium>
80
+ </medium-list>
81
+ </release>
82
+ <release id="932e9a53-af28-43be-8e6f-446da5d0a94d">
83
+ <title>Kveikur</title>
84
+ <status id="4e304316-386d-3409-af2e-78857eec5cfe">Official</status>
85
+ <quality>normal</quality>
86
+ <packaging id="f7101ce3-0384-39ce-9fde-fbbd0044d35f">Cardboard/Paper Sleeve</packaging>
87
+ <text-representation>
88
+ <language>eng</language>
89
+ <script>Latn</script>
90
+ </text-representation>
91
+ <date>2013-06-14</date>
92
+ <country>TW</country>
93
+ <release-event-list count="1">
94
+ <release-event>
95
+ <date>2013-06-14</date>
96
+ <area id="41637cec-9a4f-389c-86d2-fc6abf3357b5">
97
+ <name>Taiwan</name>
98
+ <sort-name>Taiwan</sort-name>
99
+ <iso-3166-1-code-list>
100
+ <iso-3166-1-code>TW</iso-3166-1-code>
101
+ </iso-3166-1-code-list>
102
+ <iso-3166-2-code-list>
103
+ <iso-3166-2-code>CN-71</iso-3166-2-code>
104
+ </iso-3166-2-code-list>
105
+ </area>
106
+ </release-event>
107
+ </release-event-list>
108
+ <barcode>4712765169088</barcode>
109
+ <cover-art-archive>
110
+ <artwork>true</artwork>
111
+ <count>1</count>
112
+ <front>true</front>
113
+ <back>false</back>
114
+ </cover-art-archive>
115
+ <medium-list count="1">
116
+ <medium>
117
+ <position>1</position>
118
+ <format id="9712d52a-4509-3d4b-a1a2-67c88c643e31">CD</format>
119
+ <disc-list count="1">
120
+ <disc id="pmzhT6ZlFiwSRCdVwV0eqire5_Y-">
121
+ <sectors>217171</sectors>
122
+ <offset-list count="9">
123
+ <offset position="1">150</offset>
124
+ <offset position="2">35000</offset>
125
+ <offset position="3">63711</offset>
126
+ <offset position="4">86440</offset>
127
+ <offset position="5">105891</offset>
128
+ <offset position="6">128017</offset>
129
+ <offset position="7">154668</offset>
130
+ <offset position="8">177007</offset>
131
+ <offset position="9">200379</offset>
132
+ </offset-list>
133
+ </disc>
134
+ </disc-list>
135
+ <track-list count="9"/>
136
+ </medium>
137
+ </medium-list>
138
+ </release>
139
+ </release-list>
140
+ </disc>
141
+ </metadata>