mirror of
https://github.com/antebudimir/tempus.git
synced 2026-04-16 08:47:24 +00:00
style: code clean up
This commit is contained in:
parent
a3d8b75d07
commit
dacaa03eb7
5 changed files with 29 additions and 24 deletions
|
|
@ -35,7 +35,6 @@ class StreamingCacheDataSource private constructor(
|
|||
override fun open(dataSpec: DataSpec): Long {
|
||||
val ret = cacheDataSource.open(dataSpec)
|
||||
currentDataSpec = dataSpec
|
||||
Log.d(TAG, "Opened $currentDataSpec")
|
||||
return ret
|
||||
}
|
||||
|
||||
|
|
@ -45,11 +44,13 @@ class StreamingCacheDataSource private constructor(
|
|||
|
||||
override fun close() {
|
||||
cacheDataSource.close()
|
||||
Log.d(TAG, "Closed $currentDataSpec")
|
||||
|
||||
val dataSpec = currentDataSpec
|
||||
|
||||
if (dataSpec != null) {
|
||||
val cacheKey = cacheDataSource.cacheKeyFactory.buildCacheKey(dataSpec)
|
||||
val contentLength = ContentMetadata.getContentLength(cacheDataSource.cache.getContentMetadata(cacheKey));
|
||||
|
||||
if (contentLength == C.LENGTH_UNSET.toLong()) {
|
||||
Log.d(TAG, "Removing partial cache for $cacheKey")
|
||||
cacheDataSource.cache.removeResource(cacheKey)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue