Skip to content

Commit

Permalink
Refactoring & small fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
ronjakrg committed Jun 7, 2024
1 parent 4308b1e commit 5cbb693
Show file tree
Hide file tree
Showing 14 changed files with 360 additions and 222 deletions.
82 changes: 44 additions & 38 deletions src/SpotifyConnect/SPOCAlbum.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ Class {
#name : #SPOCAlbum,
#superclass : #SPOCDataModel,
#instVars : [
'albumType',
'totalTracks',
'releaseDate',
'releaseDatePrecision',
Expand All @@ -16,49 +15,44 @@ Class {

{
#category : #accessing,
#'squeak_changestamp' : 'RK 5/15/2024 14:41'
}
SPOCAlbum >> albumType [
^ albumType
]

{
#category : #accessing,
#'squeak_changestamp' : 'RK 5/15/2024 14:43'
}
SPOCAlbum >> albumType: aString [
albumType := aString
]

{
#category : #accessing,
#'squeak_changestamp' : 'RK 5/15/2024 14:45'
#'squeak_changestamp' : 'RK 6/7/2024 10:52'
}
SPOCAlbum >> artists [

^ artists
]

{
#category : #accessing,
#'squeak_changestamp' : 'RK 5/15/2024 14:58'
#'squeak_changestamp' : 'RK 6/7/2024 10:52'
}
SPOCAlbum >> artists: anOrderedCollection [

artists := anOrderedCollection
]

{
#category : #accessing,
#'squeak_changestamp' : 'RK 5/21/2024 17:27'
#category : #formatting,
#'squeak_changestamp' : 'RK 6/7/2024 10:52'
}
SPOCAlbum >> artistsAsString [

| result |

result := ''.
self artists allButLastDo: [ :artist | result := result, artist name, ', '].
result := result, self artists last name.
^ result
]

{
#category : #formatting,
#'squeak_changestamp' : 'RK 6/7/2024 11:18'
}
SPOCAlbum >> clickAction [

^ ["To do: show all tracks from this album in resultList"]
]

{
#category : #accessing,
#'squeak_changestamp' : 'RK 6/6/2024 00:47'
Expand All @@ -79,96 +73,108 @@ SPOCAlbum >> equals: anAlbum [

{
#category : #accessing,
#'squeak_changestamp' : 'RK 5/15/2024 14:45'
#'squeak_changestamp' : 'RK 6/7/2024 10:52'
}
SPOCAlbum >> genres [

^ genres
]

{
#category : #accessing,
#'squeak_changestamp' : 'RK 5/15/2024 14:45'
#'squeak_changestamp' : 'RK 6/7/2024 10:53'
}
SPOCAlbum >> genres: anObject [
genres := anObject
SPOCAlbum >> genres: anOrderedCollection [

genres := anOrderedCollection
]

{
#category : #accessing,
#'squeak_changestamp' : 'RK 5/15/2024 14:46'
#'squeak_changestamp' : 'RK 6/7/2024 10:53'
}
SPOCAlbum >> popularity [

^ popularity
]

{
#category : #accessing,
#'squeak_changestamp' : 'RK 5/15/2024 14:46'
#'squeak_changestamp' : 'RK 6/7/2024 10:53'
}
SPOCAlbum >> popularity: anObject [
popularity := anObject
SPOCAlbum >> popularity: aNumber [

popularity := aNumber
]

{
#category : #accessing,
#'squeak_changestamp' : 'RK 5/15/2024 14:44'
#'squeak_changestamp' : 'RK 6/7/2024 10:53'
}
SPOCAlbum >> releaseDate [

^ releaseDate
]

{
#category : #accessing,
#'squeak_changestamp' : 'RK 5/15/2024 14:56'
#'squeak_changestamp' : 'RK 6/7/2024 10:53'
}
SPOCAlbum >> releaseDate: aString [

releaseDate := aString
]

{
#category : #accessing,
#'squeak_changestamp' : 'RK 5/15/2024 14:44'
#'squeak_changestamp' : 'RK 6/7/2024 10:53'
}
SPOCAlbum >> releaseDatePrecision [

^ releaseDatePrecision
]

{
#category : #accessing,
#'squeak_changestamp' : 'RK 5/15/2024 14:56'
#'squeak_changestamp' : 'RK 6/7/2024 10:53'
}
SPOCAlbum >> releaseDatePrecision: aString [

releaseDatePrecision := aString
]

{
#category : #accessing,
#'squeak_changestamp' : 'RK 5/15/2024 14:41'
#'squeak_changestamp' : 'RK 6/7/2024 10:53'
}
SPOCAlbum >> totalTracks [

^ totalTracks
]

{
#category : #accessing,
#'squeak_changestamp' : 'RK 5/15/2024 14:47'
#'squeak_changestamp' : 'RK 6/7/2024 10:53'
}
SPOCAlbum >> totalTracks: aNumber [

totalTracks := aNumber
]

{
#category : #accessing,
#'squeak_changestamp' : 'RK 5/15/2024 14:44'
#'squeak_changestamp' : 'RK 6/7/2024 10:53'
}
SPOCAlbum >> type [

^ type
]

{
#category : #accessing,
#'squeak_changestamp' : 'RK 5/15/2024 14:57'
#'squeak_changestamp' : 'RK 6/7/2024 10:53'
}
SPOCAlbum >> type: aString [

type := aString
]
34 changes: 19 additions & 15 deletions src/SpotifyConnect/SPOCApp.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -13,25 +13,28 @@ Class {

{
#category : #constants,
#'squeak_changestamp' : 'VE 5/28/2024 14:50'
#'squeak_changestamp' : 'RK 6/7/2024 10:51'
}
SPOCApp class >> appName [
^ 'Spotify Connect'.

^ 'Spotify Connect'
]

{
#category : #start,
#'squeak_changestamp' : 'VE 6/3/2024 09:12'
#'squeak_changestamp' : 'RK 6/7/2024 10:51'
}
SPOCApp class >> minimumExtent [

^ 1080 @ 720
]

{
#category : #start,
#'squeak_changestamp' : 'VE 5/28/2024 14:53'
#'squeak_changestamp' : 'RK 6/7/2024 10:51'
}
SPOCApp class >> open [

self new open
]

Expand All @@ -55,9 +58,10 @@ SPOCApp >> auth: anObject [

{
#category : #ui,
#'squeak_changestamp' : 'VE 6/3/2024 13:58'
#'squeak_changestamp' : 'RK 6/7/2024 10:50'
}
SPOCApp >> bottomPanelContent [

^ {self player}
]

Expand Down Expand Up @@ -95,7 +99,7 @@ SPOCApp >> buildCenterPanel: aBuilder [

{
#category : #ui,
#'squeak_changestamp' : 'VE 6/3/2024 10:24'
#'squeak_changestamp' : 'RK 6/7/2024 10:50'
}
SPOCApp >> buildMainTable: aBuilder [

Expand All @@ -108,7 +112,7 @@ SPOCApp >> buildMainTable: aBuilder [
vResizing: #spaceFill);
children: {self buildTopPanel: aBuilder.
self buildCenterPanel: aBuilder.
self buildBottomPanel: aBuilder.}.
self buildBottomPanel: aBuilder.}
]

{
Expand All @@ -130,7 +134,7 @@ SPOCApp >> buildTopPanel: aBuilder [

{
#category : #ui,
#'squeak_changestamp' : 'VE 6/3/2024 08:57'
#'squeak_changestamp' : 'RK 6/7/2024 10:50'
}
SPOCApp >> buildWindow: aBuilder [

Expand All @@ -139,7 +143,7 @@ SPOCApp >> buildWindow: aBuilder [
label: #windowTitle;
minimumExtent: SPOCApp minimumExtent;
children: {self buildMainTable: aBuilder};
yourself.
yourself
]

{
Expand All @@ -153,9 +157,10 @@ SPOCApp >> buildWith: aBuilder [

{
#category : #ui,
#'squeak_changestamp' : 'RK 6/5/2024 21:30'
#'squeak_changestamp' : 'RK 6/7/2024 10:50'
}
SPOCApp >> centerPanelContent [

^ {self resultList}
]

Expand Down Expand Up @@ -213,11 +218,11 @@ SPOCApp >> playerPanelContent [

{
#category : #ui,
#'squeak_changestamp' : 'VE 5/28/2024 14:57'
#'squeak_changestamp' : 'RK 6/7/2024 10:51'
}
SPOCApp >> registerOpenCommand [

TheWorldMenu registerOpenCommand: {'Spotify Connect'. {self. #open}}.
TheWorldMenu registerOpenCommand: {'Spotify Connect'. {self. #open}}

]

Expand Down Expand Up @@ -255,12 +260,11 @@ SPOCApp >> searchbar: aSPOCSearchbar [

{
#category : #initialization,
#'squeak_changestamp' : 'RK 6/6/2024 01:40'
#'squeak_changestamp' : 'RK 6/7/2024 11:25'
}
SPOCApp >> setUpResultList [

self resultList: (SPOCResultList new app: self).
self resultList updateTitle: 'Your Results'
self resultList: (SPOCResultList new app: self)
]

{
Expand Down
Loading

0 comments on commit 5cbb693

Please sign in to comment.