Skip to content

Commit 0b18346

Browse files
committed
GuileHelpers.m(get_tracks_from): Slightly more general queue_get_tracks.
1 parent 1f0aad9 commit 0b18346

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

Spotiqueue/GuileHelpers.m

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,9 +83,7 @@ SCM queue_delete_selected(void) {
8383
return [RBGuileBridge queue_delete_selected_tracks];
8484
}
8585

86-
SCM queue_get_tracks(void) {
87-
NSArray* realTracks = [RBGuileBridge queue_get_tracks];
88-
86+
SCM get_tracks_from(NSArray* realTracks) {
8987
// https://developer.apple.com/documentation/swift/int
9088
// On 32-bit platforms, Int is the same size as Int32, and on 64-bit platforms, Int is the same size as Int64.
9189
SCM tracks = scm_make_list(scm_from_int64([realTracks count]),
@@ -99,6 +97,9 @@ SCM queue_get_tracks(void) {
9997
return tracks;
10098
}
10199

100+
SCM queue_get_tracks(void) {
101+
return get_tracks_from([RBGuileBridge queue_get_tracks]);
102+
}
102103
// Eh, okay, for convenience let's say we expect this to be a list of strings with Spotify IDs.
103104
// Over in Guile land we have the wrapper `queue:set-tracks` which ensures we pass strings to `queue:_set-tracks`, this function here.
104105
SCM queue_set_tracks(SCM track_list) {

0 commit comments

Comments
 (0)