Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
TouHou.FM
Radio Go
Playlist
Commits
b9f4ea25
Verified
Commit
b9f4ea25
authored
Feb 08, 2021
by
Daniel Sonck
Browse files
Fix returned item count algorithm
parent
b8514ef9
Pipeline
#435
waiting for manual action with stages
in 4 minutes and 4 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
internal/graphql/resolver/query.resolvers.go
View file @
b9f4ea25
...
...
@@ -27,7 +27,7 @@ func (r *queryResolver) Playlist(ctx context.Context, first int, after *model.Cu
playlist
:=
r
.
PlaylistProvider
.
Playlist
()
count
:=
0
var
item
*
playlist2
.
ListItem
=
nil
for
item
=
playlist
.
Start
();
item
!=
nil
&&
count
<
first
;
item
=
item
.
Next
()
{
for
item
=
playlist
.
Start
();
item
!=
nil
&&
first
>
1
;
item
=
item
.
Next
()
{
if
count
>
start
{
result
=
append
(
result
,
model
.
PlaylistEdge
{
Cursor
:
model
.
MakeCursor
(
"PlaylistItem"
,
count
),
...
...
@@ -38,6 +38,7 @@ func (r *queryResolver) Playlist(ctx context.Context, first int, after *model.Cu
})
}
count
++
first
--
}
return
&
model
.
PlaylistConnection
{
ID
:
fmt
.
Sprintf
(
"%d:%d"
,
start
+
1
,
count
-
1
),
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment