Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
B
Backend Server
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
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
SpinShare
Backend Server
Commits
0a06774a
Commit
0a06774a
authored
Dec 21, 2020
by
Andreas Heimann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed playlist api calls
parent
60bc3d22
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
4 deletions
+9
-4
src/Controller/API/APISongPlaylistController.php
src/Controller/API/APISongPlaylistController.php
+1
-1
src/Controller/API/APIUserController.php
src/Controller/API/APIUserController.php
+8
-3
No files found.
src/Controller/API/APISongPlaylistController.php
View file @
0a06774a
...
@@ -38,7 +38,7 @@ class APISongPlaylistController extends AbstractController
...
@@ -38,7 +38,7 @@ class APISongPlaylistController extends AbstractController
return
$response
;
return
$response
;
}
else
{
}
else
{
$data
=
$result
->
getJSON
();
$data
=
$result
->
getJSON
();
$data
[
'
paths'
][
'
cover'
]
=
$baseUrl
.
"/uploads/cover/"
.
$result
->
getFileReference
()
.
".png"
;
$data
[
'cover'
]
=
$baseUrl
.
"/uploads/cover/"
.
$result
->
getFileReference
()
.
".png"
;
// Add needed paths for display
// Add needed paths for display
foreach
(
$data
[
'songs'
]
as
$songKey
=>
$songItem
)
{
foreach
(
$data
[
'songs'
]
as
$songKey
=>
$songItem
)
{
...
...
src/Controller/API/APIUserController.php
View file @
0a06774a
...
@@ -50,11 +50,13 @@ class APIUserController extends AbstractController
...
@@ -50,11 +50,13 @@ class APIUserController extends AbstractController
// Get User Lists
// Get User Lists
$resultsSongs
=
$em
->
getRepository
(
Song
::
class
)
->
findBy
(
array
(
'uploader'
=>
$result
->
getId
(),
'publicationStatus'
=>
array
(
0
,
1
)),
array
(
'uploadDate'
=>
'DESC'
));
$resultsSongs
=
$em
->
getRepository
(
Song
::
class
)
->
findBy
(
array
(
'uploader'
=>
$result
->
getId
(),
'publicationStatus'
=>
array
(
0
,
1
)),
array
(
'uploadDate'
=>
'DESC'
));
$resultsPlaylists
=
$em
->
getRepository
(
SongPlaylist
::
class
)
->
findBy
(
array
(
'user'
=>
$result
->
getId
()),
array
());
$resultsReviews
=
$em
->
getRepository
(
SongReview
::
class
)
->
findBy
(
array
(
'user'
=>
$result
->
getId
()),
array
(
'reviewDate'
=>
'DESC'
));
$resultsReviews
=
$em
->
getRepository
(
SongReview
::
class
)
->
findBy
(
array
(
'user'
=>
$result
->
getId
()),
array
(
'reviewDate'
=>
'DESC'
));
$resultsSpinPlays
=
$em
->
getRepository
(
SongSpinPlay
::
class
)
->
findBy
(
array
(
'user'
=>
$result
->
getId
(),
'isActive'
=>
true
),
array
(
'submitDate'
=>
'DESC'
));
$resultsSpinPlays
=
$em
->
getRepository
(
SongSpinPlay
::
class
)
->
findBy
(
array
(
'user'
=>
$result
->
getId
(),
'isActive'
=>
true
),
array
(
'submitDate'
=>
'DESC'
));
$resultsCards
=
$em
->
getRepository
(
UserCard
::
class
)
->
findBy
(
array
(
'user'
=>
$result
->
getId
()),
array
(
'givenDate'
=>
'DESC'
));
$resultsCards
=
$em
->
getRepository
(
UserCard
::
class
)
->
findBy
(
array
(
'user'
=>
$result
->
getId
()),
array
(
'givenDate'
=>
'DESC'
));
$data
[
'songs'
]
=
count
(
$resultsSongs
);
$data
[
'songs'
]
=
count
(
$resultsSongs
);
$data
[
'playlists'
]
=
count
(
$resultsPlaylists
);
$data
[
'reviews'
]
=
count
(
$resultsReviews
);
$data
[
'reviews'
]
=
count
(
$resultsReviews
);
$data
[
'spinplays'
]
=
count
(
$resultsSpinPlays
);
$data
[
'spinplays'
]
=
count
(
$resultsSpinPlays
);
$data
[
'cards'
]
=
[];
$data
[
'cards'
]
=
[];
...
@@ -163,10 +165,13 @@ class APIUserController extends AbstractController
...
@@ -163,10 +165,13 @@ class APIUserController extends AbstractController
$response
=
new
JsonResponse
([
'version'
=>
$this
->
getParameter
(
'api_version'
),
'status'
=>
404
,
'data'
=>
[]]);
$response
=
new
JsonResponse
([
'version'
=>
$this
->
getParameter
(
'api_version'
),
'status'
=>
404
,
'data'
=>
[]]);
return
$response
;
return
$response
;
}
else
{
}
else
{
$results
Review
s
=
$em
->
getRepository
(
SongPlaylist
::
class
)
->
findBy
(
array
(
'user'
=>
$result
->
getId
()),
array
(
'id'
=>
'DESC'
));
$results
Playlist
s
=
$em
->
getRepository
(
SongPlaylist
::
class
)
->
findBy
(
array
(
'user'
=>
$result
->
getId
()),
array
(
'id'
=>
'DESC'
));
foreach
(
$resultsReviews
as
$result
)
{
foreach
(
$resultsPlaylists
as
$result
)
{
$data
[]
=
$result
->
getJSON
();
$newItem
=
$result
->
getJSON
();
$newItem
[
'cover'
]
=
$baseUrl
.
"/uploads/cover/"
.
$result
->
getFileReference
()
.
".png"
;
$data
[]
=
$newItem
;
}
}
$response
=
new
JsonResponse
([
'version'
=>
$this
->
getParameter
(
'api_version'
),
'status'
=>
200
,
'data'
=>
$data
]);
$response
=
new
JsonResponse
([
'version'
=>
$this
->
getParameter
(
'api_version'
),
'status'
=>
200
,
'data'
=>
$data
]);
...
...
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