Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
F
front
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
funkwhale
front
Commits
10efef52
Commit
10efef52
authored
Jun 17, 2017
by
Agate
💬
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed
#18
Added lyrics
parent
82c94871
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
43 additions
and
5 deletions
+43
-5
src/components/browse/Track.vue
src/components/browse/Track.vue
+43
-5
No files found.
src/components/browse/Track.vue
View file @
10efef52
<
template
>
<div>
<div
v-if=
"isLoading"
class=
"ui vertical segment"
>
<div
v-if=
"isLoading
Track
"
class=
"ui vertical segment"
>
<div
:class=
"['ui', 'centered', 'active', 'inline', 'loader']"
></div>
</div>
<template
v-if=
"track"
>
...
...
@@ -38,6 +38,23 @@
</a>
</div>
</div>
<div
class=
"ui vertical stripe center aligned segment"
>
<h2>
Lyrics
</h2>
<div
v-if=
"isLoadingLyrics"
class=
"ui vertical segment"
>
<div
:class=
"['ui', 'centered', 'active', 'inline', 'loader']"
></div>
</div>
<div
v-if=
"lyrics"
v-html=
"lyrics.content_rendered"
>
</div>
<template
v-if=
"!isLoadingLyrics & !lyrics"
>
<p>
No lyrics available for this track.
</p>
<a
class=
"ui button"
target=
"_blank"
:href=
"lyricsSearchUrl"
>
<i
class=
"search icon"
></i>
Search on lyrics.wikia.com
</a>
</
template
>
</div>
</template>
</div>
</template>
...
...
@@ -60,22 +77,38 @@ export default {
},
data
()
{
return
{
isLoading
:
true
,
track
:
null
isLoadingTrack
:
true
,
isLoadingLyrics
:
true
,
track
:
null
,
lyrics
:
null
}
},
created
()
{
this
.
fetchData
()
this
.
fetchLyrics
()
},
methods
:
{
fetchData
()
{
var
self
=
this
this
.
isLoading
=
true
this
.
isLoading
Track
=
true
let
url
=
FETCH_URL
+
this
.
id
+
'
/
'
logger
.
default
.
debug
(
'
Fetching track "
'
+
this
.
id
+
'
"
'
)
this
.
$http
.
get
(
url
).
then
((
response
)
=>
{
self
.
track
=
response
.
data
self
.
isLoading
=
false
self
.
isLoadingTrack
=
false
})
},
fetchLyrics
()
{
var
self
=
this
this
.
isLoadingLyrics
=
true
let
url
=
FETCH_URL
+
this
.
id
+
'
/lyrics/
'
logger
.
default
.
debug
(
'
Fetching lyrics for track "
'
+
this
.
id
+
'
"
'
)
this
.
$http
.
get
(
url
).
then
((
response
)
=>
{
self
.
lyrics
=
response
.
data
self
.
isLoadingLyrics
=
false
},
(
response
)
=>
{
console
.
error
(
'
No lyrics available
'
)
self
.
isLoadingLyrics
=
false
})
}
},
...
...
@@ -91,6 +124,11 @@ export default {
return
backend
.
absoluteUrl
(
this
.
track
.
files
[
0
].
path
)
}
},
lyricsSearchUrl
()
{
let
base
=
'
http://lyrics.wikia.com/wiki/Special:Search?query=
'
let
query
=
this
.
track
.
artist
.
name
+
'
'
+
this
.
track
.
title
return
base
+
query
},
cover
()
{
return
null
},
...
...
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