Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Funkwhale Android
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
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
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
funkwhale
Funkwhale Android
Commits
c29e36c6
Commit
c29e36c6
authored
3 years ago
by
Mouath Ibrahim
Committed by
Ryan Harg
3 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Bugfix/113 fix invalid null handling playlist
parent
41519bda
No related branches found
No related tags found
1 merge request
!143
Bugfix/113 fix invalid null handling playlist
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
app/src/main/java/audio/funkwhale/ffa/repositories/PlaylistsRepository.kt
+7
-5
7 additions, 5 deletions
...a/audio/funkwhale/ffa/repositories/PlaylistsRepository.kt
changes/changelog.d/113.bugfix
+1
-0
1 addition, 0 deletions
changes/changelog.d/113.bugfix
with
8 additions
and
5 deletions
app/src/main/java/audio/funkwhale/ffa/repositories/PlaylistsRepository.kt
+
7
−
5
View file @
c29e36c6
...
...
@@ -108,7 +108,7 @@ class ManagementPlaylistsRepository(override val context: Context?) :
}
suspend
fun
remove
(
albumId
:
Int
,
index
:
Int
)
{
context
?.
let
{
if
(
context
!=
null
)
{
val
body
=
mapOf
(
"index"
to
index
)
val
request
=
Fuel
.
post
(
mustNormalizeUrl
(
"/api/v1/playlists/$albumId/remove/"
)).
apply
{
...
...
@@ -122,12 +122,13 @@ class ManagementPlaylistsRepository(override val context: Context?) :
.
header
(
"Content-Type"
,
"application/json"
)
.
body
(
Gson
().
toJson
(
body
))
.
awaitByteArrayResponseResult
()
}
}
else
{
throw
IllegalStateException
(
"Illegal state: context is null"
)
}
}
fun
move
(
id
:
Int
,
from
:
Int
,
to
:
Int
)
{
context
?.
let
{
if
(
context
!=
null
)
{
val
body
=
mapOf
(
"from"
to
from
,
"to"
to
to
)
val
request
=
Fuel
.
post
(
mustNormalizeUrl
(
"/api/v1/playlists/$id/move/"
)).
apply
{
...
...
@@ -143,7 +144,8 @@ class ManagementPlaylistsRepository(override val context: Context?) :
.
body
(
Gson
().
toJson
(
body
))
.
awaitByteArrayResponseResult
()
}
}
}
else
{
throw
IllegalStateException
(
"Illegal state: context is null"
)
}
}
}
This diff is collapsed.
Click to expand it.
changes/changelog.d/113.bugfix
0 → 100644
+
1
−
0
View file @
c29e36c6
Fix App crashes when interacting with 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