Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
funkwhale
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
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
Service Desk
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
Philipp Wolfer
funkwhale
Commits
8c04acd8
Verified
Commit
8c04acd8
authored
5 years ago
by
Eliot Berriot
Browse files
Options
Downloads
Patches
Plain Diff
Fix #812: Ensure correct track duration and playable status when browsing radios
parent
03573426
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
api/funkwhale_api/radios/views.py
+7
-2
7 additions, 2 deletions
api/funkwhale_api/radios/views.py
changes/changelog.d/812.bugfix
+1
-0
1 addition, 0 deletions
changes/changelog.d/812.bugfix
with
8 additions
and
2 deletions
api/funkwhale_api/radios/views.py
+
7
−
2
View file @
8c04acd8
...
...
@@ -5,6 +5,7 @@ from rest_framework.response import Response
from
funkwhale_api.common
import
permissions
as
common_permissions
from
funkwhale_api.music.serializers
import
TrackSerializer
from
funkwhale_api.music
import
utils
as
music_utils
from
funkwhale_api.users.oauth
import
permissions
as
oauth_permissions
from
.
import
filters
,
filtersets
,
models
,
serializers
...
...
@@ -47,7 +48,9 @@ class RadioViewSet(
def
tracks
(
self
,
request
,
*
args
,
**
kwargs
):
radio
=
self
.
get_object
()
tracks
=
radio
.
get_candidates
().
for_nested_serialization
()
actor
=
music_utils
.
get_actor_from_request
(
self
.
request
)
tracks
=
tracks
.
with_playable_uploads
(
actor
)
tracks
=
tracks
.
playable_by
(
actor
)
page
=
self
.
paginate_queryset
(
tracks
)
if
page
is
not
None
:
serializer
=
TrackSerializer
(
page
,
many
=
True
)
...
...
@@ -110,7 +113,9 @@ class RadioSessionViewSet(
def
get_serializer_context
(
self
):
context
=
super
().
get_serializer_context
()
context
[
"
user
"
]
=
self
.
request
.
user
context
[
"
user
"
]
=
(
self
.
request
.
user
if
self
.
request
.
user
.
is_authenticated
else
None
)
return
context
...
...
This diff is collapsed.
Click to expand it.
changes/changelog.d/812.bugfix
0 → 100644
+
1
−
0
View file @
8c04acd8
Ensure correct track duration and playable status when browsing radios (#812)
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