Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
funkwhale
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
Container registry
Model registry
Operate
Environments
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
Creak
funkwhale
Commits
806912c0
Commit
806912c0
authored
4 years ago
by
Agate
Browse files
Options
Downloads
Plain Diff
Merge branch '1140-the-radio-random-function-also-plays-podcasts' into 'develop'
Resolve "The "radio - random" function also plays podcasts" Closes
#1140
See merge request
!1176
parents
b62e5d9f
71318d66
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
api/funkwhale_api/radios/radios.py
+7
-3
7 additions, 3 deletions
api/funkwhale_api/radios/radios.py
changes/changelog.d/1140.bugfix
+1
-0
1 addition, 0 deletions
changes/changelog.d/1140.bugfix
with
8 additions
and
3 deletions
api/funkwhale_api/radios/radios.py
+
7
−
3
View file @
806912c0
...
@@ -102,7 +102,7 @@ class SessionRadio(SimpleRadio):
...
@@ -102,7 +102,7 @@ class SessionRadio(SimpleRadio):
class
RandomRadio
(
SessionRadio
):
class
RandomRadio
(
SessionRadio
):
def
get_queryset
(
self
,
**
kwargs
):
def
get_queryset
(
self
,
**
kwargs
):
qs
=
super
().
get_queryset
(
**
kwargs
)
qs
=
super
().
get_queryset
(
**
kwargs
)
return
qs
.
order_by
(
"
?
"
)
return
qs
.
filter
(
artist__content_category
=
"
music
"
).
order_by
(
"
?
"
)
@registry.register
(
name
=
"
favorites
"
)
@registry.register
(
name
=
"
favorites
"
)
...
@@ -116,7 +116,7 @@ class FavoritesRadio(SessionRadio):
...
@@ -116,7 +116,7 @@ class FavoritesRadio(SessionRadio):
def
get_queryset
(
self
,
**
kwargs
):
def
get_queryset
(
self
,
**
kwargs
):
qs
=
super
().
get_queryset
(
**
kwargs
)
qs
=
super
().
get_queryset
(
**
kwargs
)
track_ids
=
kwargs
[
"
user
"
].
track_favorites
.
all
().
values_list
(
"
track
"
,
flat
=
True
)
track_ids
=
kwargs
[
"
user
"
].
track_favorites
.
all
().
values_list
(
"
track
"
,
flat
=
True
)
return
qs
.
filter
(
pk__in
=
track_ids
)
return
qs
.
filter
(
pk__in
=
track_ids
,
artist__content_category
=
"
music
"
)
@registry.register
(
name
=
"
custom
"
)
@registry.register
(
name
=
"
custom
"
)
...
@@ -271,7 +271,11 @@ class LessListenedRadio(SessionRadio):
...
@@ -271,7 +271,11 @@ class LessListenedRadio(SessionRadio):
def
get_queryset
(
self
,
**
kwargs
):
def
get_queryset
(
self
,
**
kwargs
):
qs
=
super
().
get_queryset
(
**
kwargs
)
qs
=
super
().
get_queryset
(
**
kwargs
)
listened
=
self
.
session
.
user
.
listenings
.
all
().
values_list
(
"
track
"
,
flat
=
True
)
listened
=
self
.
session
.
user
.
listenings
.
all
().
values_list
(
"
track
"
,
flat
=
True
)
return
qs
.
exclude
(
pk__in
=
listened
).
order_by
(
"
?
"
)
return
(
qs
.
filter
(
artist__content_category
=
"
music
"
)
.
exclude
(
pk__in
=
listened
)
.
order_by
(
"
?
"
)
)
@registry.register
(
name
=
"
actor_content
"
)
@registry.register
(
name
=
"
actor_content
"
)
...
...
This diff is collapsed.
Click to expand it.
changes/changelog.d/1140.bugfix
0 → 100644
+
1
−
0
View file @
806912c0
Fix random radio so that podcast content is not picked up (#1140)
\ No newline at end of file
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