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
N
nextcloud-app-radio
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
46
Issues
46
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
onny
nextcloud-app-radio
Commits
05d6634d
Commit
05d6634d
authored
Nov 19, 2020
by
onny
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix settingscontroller bug, add more props to db backend
parent
ff3a7454
Pipeline
#214
failed with stages
in 11 minutes and 44 seconds
Changes
11
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
130 additions
and
51 deletions
+130
-51
lib/Controller/FavoriteController.php
lib/Controller/FavoriteController.php
+19
-10
lib/Controller/RecentController.php
lib/Controller/RecentController.php
+14
-6
lib/Controller/SettingsController.php
lib/Controller/SettingsController.php
+1
-1
lib/Db/RecentMapper.php
lib/Db/RecentMapper.php
+12
-0
lib/Db/Station.php
lib/Db/Station.php
+13
-1
lib/Migration/Version000000Date20181013124731.php
lib/Migration/Version000000Date20181013124731.php
+12
-0
lib/Service/FavoriteService.php
lib/Service/FavoriteService.php
+16
-2
lib/Service/RecentService.php
lib/Service/RecentService.php
+16
-2
src/components/Dashboard.vue
src/components/Dashboard.vue
+1
-1
src/components/Main.vue
src/components/Main.vue
+21
-26
src/components/Sidebar.vue
src/components/Sidebar.vue
+5
-2
No files found.
lib/Controller/FavoriteController.php
View file @
05d6634d
...
...
@@ -44,20 +44,29 @@ class FavoriteController extends Controller {
/**
* @NoAdminRequired
*/
public
function
create
(
string
$stationuuid
,
string
$name
,
string
$favicon
,
string
$urlresolved
):
DataResponse
{
return
new
DataResponse
(
$this
->
service
->
create
(
$stationuuid
,
$name
,
$favicon
,
$urlresolved
,
$this
->
userId
));
}
public
function
create
(
string
$stationuuid
,
string
$name
,
string
$favicon
,
string
$urlresolved
,
string
$bitrate
,
string
$country
,
string
$language
,
string
$homepage
,
string
$codec
,
string
$tags
):
DataResponse
{
return
new
DataResponse
(
$this
->
service
->
create
(
$stationuuid
,
$name
,
$favicon
,
$urlresolved
,
$bitrate
,
$country
,
$language
,
$homepage
,
$codec
,
$tags
,
$this
->
userId
));
}
/**
* @NoAdminRequired
*/
public
function
update
(
int
$id
,
string
$stationuuid
,
string
$name
,
string
$favicon
,
string
$urlresolved
):
DataResponse
{
return
$this
->
handleNotFound
(
function
()
use
(
$id
,
$stationuuid
,
$name
,
$favicon
,
$urlresolved
)
{
return
$this
->
service
->
update
(
$id
,
$stationuuid
,
$name
,
$favicon
,
$urlresolved
,
$this
->
userId
);
});
}
public
function
update
(
int
$id
,
string
$stationuuid
,
string
$name
,
string
$favicon
,
string
$urlresolved
,
string
$bitrate
,
string
$country
,
string
$language
,
string
$homepage
,
string
$codec
,
string
$tags
):
DataResponse
{
return
$this
->
handleNotFound
(
function
()
use
(
$id
,
$stationuuid
,
$name
,
$favicon
,
$urlresolved
,
$bitrate
,
$country
,
$language
,
$homepage
,
$codec
,
$tags
)
{
return
$this
->
service
->
update
(
$id
,
$stationuuid
,
$name
,
$favicon
,
$urlresolved
,
$bitrate
,
$country
,
$language
,
$homepage
,
$codec
,
$tags
,
$this
->
userId
);
});
}
/**
* @NoAdminRequired
...
...
lib/Controller/RecentController.php
View file @
05d6634d
...
...
@@ -44,18 +44,26 @@ class RecentController extends Controller {
/**
* @NoAdminRequired
*/
public
function
create
(
string
$stationuuid
,
string
$name
,
string
$favicon
,
string
$urlresolved
):
DataResponse
{
public
function
create
(
string
$stationuuid
,
string
$name
,
string
$favicon
,
string
$urlresolved
,
string
$bitrate
,
string
$country
,
string
$language
,
string
$homepage
,
string
$codec
,
string
$tags
):
DataResponse
{
return
new
DataResponse
(
$this
->
service
->
create
(
$stationuuid
,
$name
,
$favicon
,
$urlresolved
,
$this
->
userId
));
$favicon
,
$urlresolved
,
$bitrate
,
$country
,
$language
,
$homepage
,
$codec
,
$tags
,
$this
->
userId
));
}
/**
* @NoAdminRequired
*/
public
function
update
(
int
$id
,
string
$stationuuid
,
string
$name
,
string
$favicon
,
string
$urlresolved
):
DataResponse
{
return
$this
->
handleNotFound
(
function
()
use
(
$id
,
$stationuuid
,
$name
,
$favicon
,
$urlresolved
)
{
return
$this
->
service
->
update
(
$id
,
$stationuuid
,
$name
,
$favicon
,
$urlresolved
,
$this
->
userId
);
public
function
update
(
int
$id
,
string
$stationuuid
,
string
$name
,
string
$favicon
,
string
$urlresolved
,
string
$bitrate
,
string
$country
,
string
$language
,
string
$homepage
,
string
$codec
,
string
$tags
):
DataResponse
{
return
$this
->
handleNotFound
(
function
()
use
(
$id
,
$stationuuid
,
$name
,
$favicon
,
$urlresolved
,
$bitrate
,
$country
,
$language
,
$homepage
,
$codec
,
$tags
)
{
return
$this
->
service
->
update
(
$id
,
$stationuuid
,
$name
,
$favicon
,
$urlresolved
,
$bitrate
,
$country
,
$language
,
$homepage
,
$codec
,
$tags
,
$this
->
userId
);
});
}
...
...
lib/Controller/SettingsController.php
View file @
05d6634d
...
...
@@ -79,7 +79,7 @@ class SettingsController extends ApiController {
*/
public
function
setMenuState
(
$menuState
=
""
):
JSONResponse
{
if
(
$menuState
==
'SEARCH'
)
{
return
true
;
return
new
JSONResponse
([
'status'
=>
'success'
],
Http
::
STATUS_OK
)
;
};
$legalArguments
=
[
'TOP'
,
'RECENT'
,
'NEW'
,
'FAVORITES'
,
'CATEGORIES'
];
if
(
!
in_array
(
$menuState
,
$legalArguments
))
{
...
...
lib/Db/RecentMapper.php
View file @
05d6634d
...
...
@@ -27,6 +27,12 @@ class RecentMapper extends QBMapper {
->
addSelect
(
'name'
)
->
addSelect
(
'favicon'
)
->
addSelect
(
'urlresolved'
)
->
addSelect
(
'bitrate'
)
->
addSelect
(
'country'
)
->
addSelect
(
'language'
)
->
addSelect
(
'homepage'
)
->
addSelect
(
'codec'
)
->
addSelect
(
'tags'
)
->
from
(
'recent'
)
->
orderBy
(
'id'
,
'DESC'
)
->
where
(
$qb
->
expr
()
->
eq
(
'id'
,
$qb
->
createNamedParameter
(
$id
,
IQueryBuilder
::
PARAM_INT
)))
...
...
@@ -45,6 +51,12 @@ class RecentMapper extends QBMapper {
->
addSelect
(
'name'
)
->
addSelect
(
'favicon'
)
->
addSelect
(
'urlresolved'
)
->
addSelect
(
'bitrate'
)
->
addSelect
(
'country'
)
->
addSelect
(
'language'
)
->
addSelect
(
'homepage'
)
->
addSelect
(
'codec'
)
->
addSelect
(
'tags'
)
->
from
(
'recent'
)
->
orderBy
(
'id'
,
'DESC'
)
->
where
(
$qb
->
expr
()
->
eq
(
'user_id'
,
$qb
->
createNamedParameter
(
$userId
)));
...
...
lib/Db/Station.php
View file @
05d6634d
...
...
@@ -11,6 +11,12 @@ class Station extends Entity implements JsonSerializable {
protected
$name
;
protected
$favicon
;
protected
$urlresolved
;
protected
$bitrate
;
protected
$country
;
protected
$language
;
protected
$homepage
;
protected
$codec
;
protected
$tags
;
protected
$userId
;
public
function
jsonSerialize
():
array
{
...
...
@@ -19,7 +25,13 @@ class Station extends Entity implements JsonSerializable {
'stationuuid'
=>
$this
->
stationuuid
,
'name'
=>
$this
->
name
,
'favicon'
=>
$this
->
favicon
,
'urlresolved'
=>
$this
->
urlresolved
'urlresolved'
=>
$this
->
urlresolved
,
'bitrate'
=>
$this
->
bitrate
,
'country'
=>
$this
->
country
,
'language'
=>
$this
->
language
,
'homepage'
=>
$this
->
homepage
,
'codec'
=>
$this
->
codec
,
'tags'
=>
$this
->
tags
];
}
}
lib/Migration/Version000000Date20181013124731.php
View file @
05d6634d
...
...
@@ -38,6 +38,12 @@ class Version000000Date20181013124731 extends SimpleMigrationStep {
]);
$table
->
addColumn
(
'favicon'
,
'text'
);
$table
->
addColumn
(
'urlresolved'
,
'text'
);
$table
->
addColumn
(
'bitrate'
,
'text'
);
$table
->
addColumn
(
'country'
,
'text'
);
$table
->
addColumn
(
'language'
,
'text'
);
$table
->
addColumn
(
'homepage'
,
'text'
);
$table
->
addColumn
(
'codec'
,
'text'
);
$table
->
addColumn
(
'tags'
,
'text'
);
$table
->
setPrimaryKey
([
'id'
]);
$table
->
addIndex
([
'user_id'
],
'favorites_user_id_index'
);
...
...
@@ -60,6 +66,12 @@ class Version000000Date20181013124731 extends SimpleMigrationStep {
]);
$table
->
addColumn
(
'favicon'
,
'text'
);
$table
->
addColumn
(
'urlresolved'
,
'text'
);
$table
->
addColumn
(
'bitrate'
,
'text'
);
$table
->
addColumn
(
'country'
,
'text'
);
$table
->
addColumn
(
'language'
,
'text'
);
$table
->
addColumn
(
'homepage'
,
'text'
);
$table
->
addColumn
(
'codec'
,
'text'
);
$table
->
addColumn
(
'tags'
,
'text'
);
$table
->
setPrimaryKey
([
'id'
]);
$table
->
addIndex
([
'user_id'
],
'recent_user_id_index'
);
...
...
lib/Service/FavoriteService.php
View file @
05d6634d
...
...
@@ -45,23 +45,37 @@ class FavoriteService {
}
}
public
function
create
(
$stationuuid
,
$name
,
$favicon
,
$urlresolved
,
$userId
)
{
public
function
create
(
$stationuuid
,
$name
,
$favicon
,
$urlresolved
,
$bitrate
,
$country
,
$language
,
$homepage
,
$codec
,
$tags
,
$userId
)
{
$station
=
new
Station
();
$station
->
setStationuuid
(
$stationuuid
);
$station
->
setName
(
$name
);
$station
->
setFavicon
(
$favicon
);
$station
->
setUrlresolved
(
$urlresolved
);
$station
->
setBitrate
(
$bitrate
);
$station
->
setCountry
(
$country
);
$station
->
setLanguage
(
$language
);
$station
->
setHomepage
(
$homepage
);
$station
->
setCodec
(
$codec
);
$station
->
setTags
(
$tags
);
$station
->
setUserId
(
$userId
);
return
$this
->
mapper
->
insert
(
$station
);
}
public
function
update
(
$id
,
$stationuuid
,
$name
,
$favicon
,
$urlresolved
,
$userId
)
{
public
function
update
(
$id
,
$stationuuid
,
$name
,
$favicon
,
$urlresolved
,
$bitrate
,
$country
,
$language
,
$homepage
,
$codec
,
$tags
,
$userId
)
{
try
{
$station
=
$this
->
mapper
->
find
(
$id
,
$userId
);
$station
->
setStationuuid
(
$stationuuid
);
$station
->
setName
(
$name
);
$station
->
setFavicon
(
$favicon
);
$station
->
setUrlresolved
(
$urlresolved
);
$station
->
setBitrate
(
$bitrate
);
$station
->
setCountry
(
$country
);
$station
->
setLanguage
(
$language
);
$station
->
setHomepage
(
$homepage
);
$station
->
setCodec
(
$codec
);
$station
->
setTags
(
$tags
);
return
$this
->
mapper
->
update
(
$station
);
}
catch
(
Exception
$e
)
{
$this
->
handleException
(
$e
);
...
...
lib/Service/RecentService.php
View file @
05d6634d
...
...
@@ -45,23 +45,37 @@ class RecentService {
}
}
public
function
create
(
$stationuuid
,
$name
,
$favicon
,
$urlresolved
,
$userId
)
{
public
function
create
(
$stationuuid
,
$name
,
$favicon
,
$urlresolved
,
$bitrate
,
$country
,
$language
,
$homepage
,
$codec
,
$tags
,
$userId
)
{
$station
=
new
Station
();
$station
->
setStationuuid
(
$stationuuid
);
$station
->
setName
(
$name
);
$station
->
setFavicon
(
$favicon
);
$station
->
setUrlresolved
(
$urlresolved
);
$station
->
setBitrate
(
$bitrate
);
$station
->
setCountry
(
$country
);
$station
->
setLanguage
(
$language
);
$station
->
setHomepage
(
$homepage
);
$station
->
setCodec
(
$codec
);
$station
->
setTags
(
$tags
);
$station
->
setUserId
(
$userId
);
return
$this
->
mapper
->
insert
(
$station
);
}
public
function
update
(
$id
,
$stationuuid
,
$name
,
$favicon
,
$urlresolved
,
$userId
)
{
public
function
update
(
$id
,
$stationuuid
,
$name
,
$favicon
,
$urlresolved
,
$bitrate
,
$country
,
$language
,
$homepage
,
$codec
,
$tags
,
$userId
)
{
try
{
$station
=
$this
->
mapper
->
find
(
$id
,
$userId
);
$station
->
setStationuuid
(
$stationuuid
);
$station
->
setName
(
$name
);
$station
->
setFavicon
(
$favicon
);
$station
->
setUrlresolved
(
$urlresolved
);
$station
->
setBitrate
(
$bitrate
);
$station
->
setCountry
(
$country
);
$station
->
setLanguage
(
$language
);
$station
->
setHomepage
(
$homepage
);
$station
->
setCodec
(
$codec
);
$station
->
setTags
(
$tags
);
return
$this
->
mapper
->
update
(
$station
);
}
catch
(
Exception
$e
)
{
$this
->
handleException
(
$e
);
...
...
src/components/Dashboard.vue
View file @
05d6634d
...
...
@@ -55,7 +55,7 @@ export default {
targetUrl
:
generateUrl
(
'
/apps/radio/#/favorites
'
),
avatarUrl
:
n
.
favicon
,
mainText
:
n
.
name
,
subText
:
n
.
tags
,
subText
:
n
.
tags
.
replaceAll
(
'
,
'
,
'
,
'
)
,
}
})
},
...
...
src/components/Main.vue
View file @
05d6634d
...
...
@@ -61,7 +61,7 @@ export default {
blurHashes
:
require
(
'
../assets/blurHashes.json
'
),
favorites
:
[],
showSidebar
:
false
,
sidebarStation
:
[]
,
sidebarStation
:
{}
,
}),
computed
:
{
player
()
{
...
...
@@ -161,10 +161,16 @@ export default {
}
const
stationMap
=
{
id
:
-
1
,
name
:
station
.
name
,
urlresolved
:
stationSrc
,
favicon
:
station
.
favicon
,
stationuuid
:
station
.
stationuuid
,
name
:
station
.
name
.
toString
(),
urlresolved
:
stationSrc
.
toString
(),
favicon
:
station
.
favicon
.
toString
(),
stationuuid
:
station
.
stationuuid
.
toString
(),
bitrate
:
station
.
bitrate
.
toString
(),
country
:
station
.
country
.
toString
(),
language
:
station
.
language
.
toString
(),
homepage
:
station
.
homepage
.
toString
(),
codec
:
station
.
codec
.
toString
(),
tags
:
station
.
tags
.
toString
(),
}
await
axios
.
post
(
generateUrl
(
'
/apps/radio/api/favorites
'
),
stationMap
)
...
...
@@ -246,10 +252,16 @@ export default {
}
const
stationMap
=
{
id
:
-
1
,
name
:
station
.
name
,
urlresolved
:
stationSrc
,
favicon
:
station
.
favicon
,
stationuuid
:
station
.
stationuuid
,
name
:
station
.
name
.
toString
(),
urlresolved
:
stationSrc
.
toString
(),
favicon
:
station
.
favicon
.
toString
(),
stationuuid
:
station
.
stationuuid
.
toString
(),
bitrate
:
station
.
bitrate
.
toString
(),
country
:
station
.
country
.
toString
(),
language
:
station
.
language
.
toString
(),
homepage
:
station
.
homepage
.
toString
(),
codec
:
station
.
codec
.
toString
(),
tags
:
station
.
tags
.
toString
(),
}
await
axios
.
post
(
generateUrl
(
'
/apps/radio/api/recent
'
),
stationMap
)
...
...
@@ -390,27 +402,10 @@ export default {
<
style
>
/* Make breadcrumbs sticky and intransparent.
Move them to the right and show navigation
toggle on smaller screens */
.breadcrumbs
{
background-color
:
var
(
--color-main-background-translucent
);
z-index
:
60
;
position
:
sticky
;
position
:
-webkit-sticky
;
top
:
50px
;
padding-bottom
:
5px
;
margin-left
:
35px
;
}
@media
only
screen
and
(
min-width
:
1024px
)
{
.app-navigation-toggle
{
display
:
none
;
}
.breadcrumbs
{
margin-left
:
0px
;
}
}
</
style
>
src/components/Sidebar.vue
View file @
05d6634d
...
...
@@ -79,8 +79,10 @@ export default {
default
()
{
return
false
},
},
sidebarStation
:
{
type
:
Array
,
default
()
{
return
[]
},
type
:
Object
,
default
()
{
return
{}
},
},
},
computed
:
{
...
...
@@ -103,6 +105,7 @@ export default {
this
.
$emit
(
'
toggleSidebar
'
)
},
copyLink
()
{
console
.
log
(
this
.
sidebarStation
.
favicon
)
this
.
$copyText
(
this
.
urlResolved
).
then
(
function
()
{
showSuccess
(
t
(
'
radio
'
,
'
Link copied to clipboard
'
))
...
...
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