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
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
Zwordi
funkwhale
Commits
2f5a13a3
Verified
Commit
2f5a13a3
authored
6 years ago
by
Eliot Berriot
Browse files
Options
Downloads
Patches
Plain Diff
Fix
#199
: unplayable tracks are now properly disabled in the interface
parent
6f79dd47
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
api/funkwhale_api/music/admin.py
+7
-1
7 additions, 1 deletion
api/funkwhale_api/music/admin.py
changes/changelog.d/199.bugfix
+1
-0
1 addition, 0 deletions
changes/changelog.d/199.bugfix
front/src/components/audio/PlayButton.vue
+15
-5
15 additions, 5 deletions
front/src/components/audio/PlayButton.vue
with
23 additions
and
6 deletions
api/funkwhale_api/music/admin.py
+
7
−
1
View file @
2f5a13a3
...
...
@@ -38,6 +38,7 @@ class ImportBatchAdmin(admin.ModelAdmin):
search_fields
=
[
'
import_request__name
'
,
'
source
'
,
'
batch__pk
'
,
'
mbid
'
]
@admin.register
(
models
.
ImportJob
)
class
ImportJobAdmin
(
admin
.
ModelAdmin
):
list_display
=
[
'
source
'
,
'
batch
'
,
'
track_file
'
,
'
status
'
,
'
mbid
'
]
...
...
@@ -77,5 +78,10 @@ class TrackFileAdmin(admin.ModelAdmin):
list_select_related
=
[
'
track
'
]
search_fields
=
[
'
source
'
,
'
acoustid_track_id
'
]
search_fields
=
[
'
source
'
,
'
acoustid_track_id
'
,
'
track__title
'
,
'
track__album__title
'
,
'
track__artist__name
'
]
list_filter
=
[
'
mimetype
'
]
This diff is collapsed.
Click to expand it.
changes/changelog.d/199.bugfix
0 → 100644
+
1
−
0
View file @
2f5a13a3
Uplayable tracks are now properly disabled in the interface (#199)
This diff is collapsed.
Click to expand it.
front/src/components/audio/PlayButton.vue
+
15
−
5
View file @
2f5a13a3
<
template
>
<div
:class=
"['ui',
{'tiny': discrete}, 'buttons']">
<div
:title=
"title"
:class=
"['ui',
{'tiny': discrete}, 'buttons']">
<button
:title=
"$t('Add to current queue')"
@
click=
"addNext(true)"
:disabled=
"!playable"
:class=
"['ui',
{loading: isLoading}, {'mini': discrete}, {disabled: !playable}, 'button']">
<i
class=
"ui play icon"
></i>
<template
v-if=
"!discrete"
><slot><i18next
path=
"Play"
/></slot></
template
>
...
...
@@ -10,9 +11,9 @@
<div
v-if=
"!discrete"
:class=
"['ui', {disabled: !playable}, 'floating', 'dropdown', 'icon', 'button']"
>
<i
class=
"dropdown icon"
></i>
<div
class=
"menu"
>
<div
class=
"item"
@
click=
"add"
><i
class=
"plus icon"
></i><i18next
path=
"Add to queue"
/></div>
<div
class=
"item"
@
click=
"addNext()"
><i
class=
"step forward icon"
></i><i18next
path=
"Play next"
/></div>
<div
class=
"item"
@
click=
"addNext(true)"
><i
class=
"arrow down icon"
></i><i18next
path=
"Play now"
/></div>
<div
class=
"item"
:disabled=
"!playable"
@
click=
"add"
><i
class=
"plus icon"
></i><i18next
path=
"Add to queue"
/></div>
<div
class=
"item"
:disabled=
"!playable"
@
click=
"addNext()"
><i
class=
"step forward icon"
></i><i18next
path=
"Play next"
/></div>
<div
class=
"item"
:disabled=
"!playable"
@
click=
"addNext(true)"
><i
class=
"arrow down icon"
></i><i18next
path=
"Play now"
/></div>
</div>
</div>
</div>
...
...
@@ -45,9 +46,18 @@ export default {
jQuery
(
this
.
$el
).
find
(
'
.ui.dropdown
'
).
dropdown
()
},
computed
:
{
title
()
{
if
(
this
.
playable
)
{
return
this
.
$t
(
'
Play immediatly
'
)
}
else
{
if
(
this
.
track
)
{
return
this
.
$t
(
'
This track is not imported and cannot be played
'
)
}
}
},
playable
()
{
if
(
this
.
track
)
{
return
t
rue
return
t
his
.
track
.
files
.
length
>
0
}
else
if
(
this
.
tracks
)
{
return
this
.
tracks
.
length
>
0
}
else
if
(
this
.
playlist
)
{
...
...
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