Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
play
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
AURA
play
Commits
3ca282c1
Commit
3ca282c1
authored
5 months ago
by
David Trattnig
Browse files
Options
Downloads
Patches
Plain Diff
feat: return all future episodes with title and (summary or content)
parent
55aa7883
No related branches found
No related tags found
No related merge requests found
Pipeline
#8663
passed
5 months ago
Stage: build
Stage: deploy
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/lib/components/ShowDetail.svelte
+14
-1
14 additions, 1 deletion
src/lib/components/ShowDetail.svelte
with
14 additions
and
1 deletion
src/lib/components/ShowDetail.svelte
+
14
−
1
View file @
3ca282c1
...
...
@@ -124,15 +124,19 @@
let
next
=
[];
let
gotCurrent
=
false
;
for
(
let
episode
of
data
)
{
// Future and current episode
if
(
new
Date
(
episode
.
end
)
>
new
Date
())
{
// Current episode
if
(
!
gotCurrent
)
{
// Mark the current, next episode
episode
[
'
isCurrent
'
]
=
true
;
gotCurrent
=
true
;
past
.
push
(
episode
);
// Future episode
}
else
{
next
.
push
(
episode
);
}
// Past episode
}
else
{
past
.
push
(
episode
);
}
...
...
@@ -143,8 +147,17 @@
past
=
past
.
slice
(
0
,
defaultPastEpisodes
);
episodes
=
past
;
console
.
log
(
'
Base episodes of show API response:
'
,
data
);
// Limit and order all future episodes
episodesNext
=
next
.
slice
(
0
,
maxFutureEpisodes
).
reverse
();
console
.
log
(
'
Next (n) episodes of show API response:
'
,
data
);
console
.
log
(
'
Next (n) episodes of show API response:
'
,
episodesNext
);
// Return all future episodes which have some title & description
const
episodesCompleteNext
=
next
.
filter
(
(
e
)
=>
e
.
note
.
title
&&
(
e
.
note
.
summary
||
e
.
note
.
content
)
);
episodes
=
episodesCompleteNext
.
concat
(
episodes
);
console
.
log
(
'
Next complete episodes of show API response:
'
,
episodesCompleteNext
);
show
=
tmp_show
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment