Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Funkwhale Android
Manage
Activity
Members
Labels
Plan
Issues
72
Issue boards
Milestones
Wiki
Code
Merge requests
1
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
Merge requests
!66
74: Add logs for queue management
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
74: Add logs for queue management
bugfix/74-add-track-playing-logs
into
develop
Overview
0
Commits
1
Pipelines
2
Changes
3
Merged
Ryan Harg
requested to merge
bugfix/74-add-track-playing-logs
into
develop
3 years ago
Overview
0
Commits
1
Pipelines
2
Changes
3
Expand
👍
0
👎
0
Merge request reports
Compare
develop
version 1
981fe520
3 years ago
develop (base)
and
latest version
latest version
c8382495
1 commit,
3 years ago
version 1
981fe520
1 commit,
3 years ago
3 files
+
93
−
49
Side-by-side
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
3
Search (e.g. *.vue) (Ctrl+P)
app/src/main/java/audio/funkwhale/ffa/playback/CacheDataSourceFactoryProvider.kt
0 → 100644
+
46
−
0
Options
package
audio.funkwhale.ffa.playback
import
android.content.Context
import
audio.funkwhale.ffa.R
import
audio.funkwhale.ffa.utils.OAuth
import
audio.funkwhale.ffa.utils.Settings
import
com.google.android.exoplayer2.upstream.DataSource
import
com.google.android.exoplayer2.upstream.DefaultHttpDataSourceFactory
import
com.google.android.exoplayer2.upstream.FileDataSource
import
com.google.android.exoplayer2.upstream.cache.Cache
import
com.google.android.exoplayer2.upstream.cache.CacheDataSource
import
com.google.android.exoplayer2.upstream.cache.CacheDataSourceFactory
import
com.google.android.exoplayer2.util.Util
class
CacheDataSourceFactoryProvider
(
private
val
oAuth
:
OAuth
,
private
val
exoCache
:
Cache
,
private
val
exoDownloadCache
:
Cache
)
{
fun
create
(
context
:
Context
):
CacheDataSourceFactory
{
val
playbackCache
=
CacheDataSourceFactory
(
exoCache
,
createDatasourceFactory
(
context
,
oAuth
))
return
CacheDataSourceFactory
(
exoDownloadCache
,
playbackCache
,
FileDataSource
.
Factory
(),
null
,
CacheDataSource
.
FLAG_IGNORE_CACHE_ON_ERROR
,
null
)
}
private
fun
createDatasourceFactory
(
context
:
Context
,
oAuth
:
OAuth
):
DataSource
.
Factory
{
val
http
=
DefaultHttpDataSourceFactory
(
Util
.
getUserAgent
(
context
,
context
.
getString
(
R
.
string
.
app_name
))
)
return
if
(!
Settings
.
isAnonymous
())
{
OAuth2DatasourceFactory
(
context
,
http
,
oAuth
)
}
else
{
http
}
}
}
\ No newline at end of file
Loading