Skip to content

Commit 0869500

Browse files
committed
Merge origin/development into development
2 parents fb18cfe + 62bbb72 commit 0869500

16 files changed

+254
-386
lines changed

src/SpotifyConnect/SPOCApiAlbum.class.st

+2-3
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ SPOCApiAlbum >> getAlbumWithID: aString [
5656

5757
{
5858
#category : #response,
59-
#'squeak_changestamp' : 'RK 7/7/2024 13:53'
59+
#'squeak_changestamp' : 'VE 7/8/2024 18:40'
6060
}
6161
SPOCApiAlbum >> tinkerReponseContent: aContentStream [
6262

@@ -65,7 +65,6 @@ SPOCApiAlbum >> tinkerReponseContent: aContentStream [
6565
tracks := OrderedCollection new.
6666
index := 0.
6767
(content at: #items)
68-
do: [:anItem | tracks add: ((self tinkerTrack: anItem) offset: index + 1).
69-
index := index + 1].
68+
do: [:anItem | tracks add: (self tinkerTrack: anItem)].
7069
^ tracks
7170
]

src/SpotifyConnect/SPOCApiEndpointResult.class.st

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Class {
99
'error',
1010
'response'
1111
],
12-
#category : #'SpotifyConnect-Utils',
12+
#category : #'SpotifyConnect-API',
1313
#'squeak_changestamp' : 'OW 7/4/2024 12:31'
1414
}
1515

src/SpotifyConnect/SPOCApiPlaylist.class.st

+3-5
Original file line numberDiff line numberDiff line change
@@ -56,16 +56,14 @@ SPOCApiPlaylist >> getPlaylistWithID: aString [
5656

5757
{
5858
#category : #response,
59-
#'squeak_changestamp' : 'RK 7/7/2024 13:53'
59+
#'squeak_changestamp' : 'VE 7/8/2024 18:39'
6060
}
6161
SPOCApiPlaylist >> tinkerReponseContent: aContentStream [
6262

63-
| content tracks index |
63+
| content tracks |
6464
content := Json readFrom: aContentStream readStream.
6565
tracks := OrderedCollection new.
66-
index := 0.
6766
(content at: #items)
68-
do: [:anItem | tracks add: ((self tinkerTrack: (anItem at: #track)) offset: index + 1).
69-
index := index + 1].
67+
do: [:anItem | tracks add: (self tinkerTrack: (anItem at: #track))].
7068
^ tracks
7169
]

src/SpotifyConnect/SPOCApiSearch.class.st

+1-2
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ SPOCApiSearch >> search: aString withFilter: aFilter [
7070

7171
{
7272
#category : #response,
73-
#'squeak_changestamp' : 'VE 7/8/2024 16:43'
73+
#'squeak_changestamp' : 'VE 7/8/2024 18:38'
7474
}
7575
SPOCApiSearch >> tinkerReponseContent: aContentStream [
7676

@@ -83,6 +83,5 @@ SPOCApiSearch >> tinkerReponseContent: aContentStream [
8383
do: [:anAlbum | results add: (self tinkerAlbum: anAlbum)].
8484
(self contentItemsAt: #playlists in: content)
8585
do: [:aPlaylist | results add: (self tinkerPlaylist: aPlaylist)].
86-
results withIndexDo: [:aDataPiece :anIndex | aDataPiece offset: anIndex].
8786
^ results
8887
]

src/SpotifyConnect/SPOCApiTrack.class.st

-59
This file was deleted.

src/SpotifyConnect/SPOCApp.class.st

+2-1
Original file line numberDiff line numberDiff line change
@@ -588,12 +588,13 @@ SPOCApp >> topPanelContent [
588588

589589
{
590590
#category : #updating,
591-
#'squeak_changestamp' : 'TL 7/7/2024 01:51'
591+
#'squeak_changestamp' : 'VE 7/8/2024 18:17'
592592
}
593593
SPOCApp >> updatePlaybackState [
594594

595595
| playbackState |
596596
playbackState := self getPlaybackState.
597+
(playbackState class = SPOCApiEndpointResult) ifTrue: [^ self].
597598
self componentsForUpdatingPlaybackState
598599
do: [:aComponent | aComponent updatePlaybackState: playbackState]
599600
]

src/SpotifyConnect/SPOCBoxedTextWithIcon.class.st

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ SPOCBoxedTextWithIcon class >> iconPadding [
1919

2020
{
2121
#category : #constructor,
22-
#'squeak_changestamp' : 'TL 7/8/2024 17:38'
22+
#'squeak_changestamp' : 'TL 7/8/2024 19:02'
2323
}
2424
SPOCBoxedTextWithIcon class >> newWithText: aString withIcon: anAssetPath [
2525

src/SpotifyConnect/SPOCDataPiece.class.st

-20
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ Class {
88
'id',
99
'image',
1010
'name',
11-
'offset',
1211
'hasTertiaryText'
1312
],
1413
#category : #SpotifyConnect,
@@ -123,25 +122,6 @@ SPOCDataPiece >> name: aString [
123122
name := aString
124123
]
125124

126-
{
127-
#category : #accessing,
128-
#'squeak_changestamp' : 'TL 7/7/2024 02:32'
129-
}
130-
SPOCDataPiece >> offset [
131-
"Offset within a search result, album or playlist"
132-
133-
^ offset
134-
]
135-
136-
{
137-
#category : #accessing,
138-
#'squeak_changestamp' : 'RK 6/16/2024 13:59'
139-
}
140-
SPOCDataPiece >> offset: aNumber [
141-
142-
offset := aNumber
143-
]
144-
145125
{
146126
#category : #'event handling',
147127
#'squeak_changestamp' : 'RK 6/16/2024 12:10'

src/SpotifyConnect/SPOCPlayer.class.st

+35-44
Original file line numberDiff line numberDiff line change
@@ -54,60 +54,48 @@ SPOCPlayer class >> previousIconPath [
5454

5555
{
5656
#category : #initialization,
57-
#'squeak_changestamp' : 'VE 6/10/2024 22:27'
57+
#'squeak_changestamp' : 'VE 7/8/2024 18:51'
5858
}
5959
SPOCPlayer >> attachButton: anIcon [
6060

61-
self button: (SPOCClickable
62-
newUsing: anIcon
63-
onClick: [:anEvent | self executeButtonFunction: anIcon]);
61+
self button: (SPOCClickable newUsing: anIcon onClick: [:anEvent | self executeButtonFunction: anIcon]);
6462
addMorph: self button
6563
]
6664

6765
{
6866
#category : #initialization,
69-
#'squeak_changestamp' : 'TL 6/18/2024 23:35'
67+
#'squeak_changestamp' : 'VE 7/8/2024 18:51'
7068
}
7169
SPOCPlayer >> attachNextButton [
7270

73-
self nextIcon: (SPOCIcon new
74-
iconAsset: self class nextIconPath;
75-
color: Color transparent;
76-
yourself);
77-
attachButton: self nextIcon;
78-
addMorph: (Morph new
71+
self nextIcon: (SPOCIcon new iconAsset: self class nextIconPath;
7972
color: Color transparent;
80-
extent: 15 @ self button height;
81-
yourself)
73+
yourself);
74+
attachButton: self nextIcon;
75+
addMorph: self spacerMorph.
8276
]
8377

8478
{
8579
#category : #initialization,
86-
#'squeak_changestamp' : 'TL 6/18/2024 23:35'
80+
#'squeak_changestamp' : 'VE 7/8/2024 18:51'
8781
}
8882
SPOCPlayer >> attachPlayPauseButton [
8983

90-
self playPauseIcon: (SPOCIcon new
91-
iconAsset: self class playIconPath;
92-
yourself);
84+
self playPauseIcon: (SPOCIcon new iconAsset: self class playIconPath);
9385
attachButton: self playPauseIcon;
94-
addMorph: (Morph new
95-
color: Color transparent;
96-
extent: 15 @ self button height;
97-
yourself);
86+
addMorph: self spacerMorph;
9887
updatePlayPauseIcon
9988
]
10089

10190
{
10291
#category : #initialization,
103-
#'squeak_changestamp' : 'TL 6/18/2024 23:36'
92+
#'squeak_changestamp' : 'VE 7/8/2024 18:51'
10493
}
10594
SPOCPlayer >> attachPreviousButton [
10695

107-
self previousIcon: (SPOCIcon new
108-
iconAsset: self class previousIconPath;
109-
color: Color transparent;
110-
yourself);
96+
self previousIcon: (SPOCIcon new iconAsset: self class previousIconPath;
97+
color: Color transparent;
98+
yourself);
11199
attachButton: self previousIcon
112100
]
113101

@@ -239,23 +227,21 @@ SPOCPlayer >> nextIcon: anObject [
239227

240228
{
241229
#category : #'api-call',
242-
#'squeak_changestamp' : 'VE 6/26/2024 14:41'
230+
#'squeak_changestamp' : 'VE 7/8/2024 18:48'
243231
}
244232
SPOCPlayer >> pause [
245233

246-
SPOCApiPause new
247-
authorizer: self app auth;
234+
SPOCApiPause new authorizer: self app auth;
248235
pauseOn: self deviceID
249236
]
250237

251238
{
252239
#category : #'api-call',
253-
#'squeak_changestamp' : 'VE 6/26/2024 14:41'
240+
#'squeak_changestamp' : 'VE 7/8/2024 18:48'
254241
}
255242
SPOCPlayer >> play [
256243

257-
SPOCApiPlay new
258-
authorizer: self app auth;
244+
SPOCApiPlay new authorizer: self app auth;
259245
playOn: self deviceID
260246
]
261247

@@ -297,32 +283,37 @@ SPOCPlayer >> previousIcon: anObject [
297283

298284
{
299285
#category : #'api-call',
300-
#'squeak_changestamp' : 'RK 7/7/2024 14:20'
286+
#'squeak_changestamp' : 'VE 7/8/2024 18:48'
301287
}
302288
SPOCPlayer >> skipToNext [
303289

304-
SPOCApiNext new
305-
authorizer: self app auth;
306-
skipToNextOn: self deviceID;
307-
yourself.
308-
self app resultList updateHighlightedTrackWithOffset: 1.
290+
SPOCApiNext new authorizer: self app auth;
291+
skipToNextOn: self deviceID.
309292
self app updatePlaybackState
310293
]
311294

312295
{
313296
#category : #'api-call',
314-
#'squeak_changestamp' : 'RK 7/7/2024 14:20'
297+
#'squeak_changestamp' : 'VE 7/8/2024 18:48'
315298
}
316299
SPOCPlayer >> skipToPrevious [
317300

318-
SPOCApiPrevious new
319-
authorizer: self app auth;
320-
skipToPreviousOn: self deviceID;
321-
yourself.
322-
self app resultList updateHighlightedTrackWithOffset: -1.
301+
SPOCApiPrevious new authorizer: self app auth;
302+
skipToPreviousOn: self deviceID.
323303
self app updatePlaybackState
324304
]
325305

306+
{
307+
#category : #initialization,
308+
#'squeak_changestamp' : 'VE 7/8/2024 18:52'
309+
}
310+
SPOCPlayer >> spacerMorph [
311+
312+
^ Morph new color: Color transparent;
313+
extent: SPOCStyle defaultMargin @ self button height;
314+
yourself
315+
]
316+
326317
{
327318
#category : #actions,
328319
#'squeak_changestamp' : 'VE 6/26/2024 14:41'

src/SpotifyConnect/SPOCRecentlyPlayed.class.st

+6-11
Original file line numberDiff line numberDiff line change
@@ -50,18 +50,13 @@ SPOCRecentlyPlayed class >> trackLimit [
5050

5151
{
5252
#category : #building,
53-
#'squeak_changestamp' : 'VK 7/7/2024 14:30'
53+
#'squeak_changestamp' : 'VE 7/8/2024 18:43'
5454
}
55-
SPOCRecentlyPlayed >> buildButton [
55+
SPOCRecentlyPlayed >> attachButton [
5656

57-
| text button |
57+
| text |
5858
text := SPOCBoxedTextWithIcon newWithText: 'Recently Played' withIcon: self class recentlyPlayedIconPath.
59-
button := Morph new color: Color transparent;
60-
addMorph: text;
61-
yourself.
62-
button extent: 0@0;
63-
extent: button fullBounds extent.
64-
self addMorph: (SPOCClickable newUsing: button onClick: [:anEvent | self getRecentlyPlayed])
59+
self addMorph: (SPOCClickable newUsing: text onClick: [:anEvent | self getRecentlyPlayed])
6560
]
6661

6762
{
@@ -82,7 +77,7 @@ SPOCRecentlyPlayed >> getRecentlyPlayed [
8277

8378
{
8479
#category : #initialization,
85-
#'squeak_changestamp' : 'RK 6/15/2024 16:41'
80+
#'squeak_changestamp' : 'VE 7/8/2024 18:43'
8681
}
8782
SPOCRecentlyPlayed >> initialize [
8883

@@ -92,7 +87,7 @@ SPOCRecentlyPlayed >> initialize [
9287
color: Color transparent;
9388
items: OrderedCollection new;
9489
results: OrderedCollection new;
95-
buildButton;
90+
attachButton;
9691
extendFully;
9792
yourself
9893
]

src/SpotifyConnect/SPOCRefresh.class.st

+3-7
Original file line numberDiff line numberDiff line change
@@ -23,16 +23,12 @@ SPOCRefresh class >> refreshIconPath [
2323

2424
{
2525
#category : #initialization,
26-
#'squeak_changestamp' : 'VE 7/2/2024 18:46'
26+
#'squeak_changestamp' : 'VE 7/8/2024 18:42'
2727
}
2828
SPOCRefresh >> attachButton [
2929

30-
self icon: (SPOCIcon new
31-
iconAsset: self class refreshIconPath;
32-
yourself);
33-
button: (SPOCClickable
34-
newUsing: self icon
35-
onClick: [:anEvent | self refresh]);
30+
self icon: (SPOCIcon new iconAsset: self class refreshIconPath);
31+
button: (SPOCClickable newUsing: self icon onClick: [:anEvent | self refresh]);
3632
addMorph: self button
3733
]
3834

0 commit comments

Comments
 (0)