Remove unused parameters from getDownloadInputStream()

This commit is contained in:
tzugen 2021-04-10 13:15:54 +02:00
parent 6b750dac4d
commit a13306c680
No known key found for this signature in database
GPG Key ID: 61E9C34BC10EC930
5 changed files with 6 additions and 10 deletions

View File

@ -321,9 +321,9 @@ public class CachedMusicService implements MusicService
}
@Override
public Pair<InputStream, Boolean> getDownloadInputStream(Context context, MusicDirectory.Entry song, long offset, int maxBitrate, CancellableTask task) throws Exception
public Pair<InputStream, Boolean> getDownloadInputStream(MusicDirectory.Entry song, long offset, int maxBitrate) throws Exception
{
return musicService.getDownloadInputStream(context, song, offset, maxBitrate, task);
return musicService.getDownloadInputStream(song, offset, maxBitrate);
}
@Override

View File

@ -377,8 +377,7 @@ public class DownloadFile
{
// Attempt partial HTTP GET, appending to the file if it exists.
Pair<InputStream, Boolean> response = musicService
.getDownloadInputStream(context, song, partialFile.length(), bitRate,
DownloadTask.this);
.getDownloadInputStream(song, partialFile.length(), bitRate);
if (response.getSecond())
{

View File

@ -108,7 +108,7 @@ public interface MusicService
* Return response {@link InputStream} and a {@link Boolean} that indicates if this response is
* partial.
*/
Pair<InputStream, Boolean> getDownloadInputStream(Context context, MusicDirectory.Entry song, long offset, int maxBitrate, CancellableTask task) throws Exception;
Pair<InputStream, Boolean> getDownloadInputStream(MusicDirectory.Entry song, long offset, int maxBitrate) throws Exception;
// TODO: Refactor and remove this call (see RestMusicService implementation)
String getVideoUrl(Context context, String id, boolean useFlash) throws Exception;

View File

@ -893,7 +893,7 @@ public class OfflineMusicService implements MusicService
}
@Override
public Pair<InputStream, Boolean> getDownloadInputStream(Context context, MusicDirectory.Entry song, long offset, int maxBitrate, CancellableTask task) {
public Pair<InputStream, Boolean> getDownloadInputStream(MusicDirectory.Entry song, long offset, int maxBitrate) {
Timber.w("OfflineMusicService.getDownloadInputStream was called but it isn't available");
return null;
}

View File

@ -59,7 +59,6 @@ import org.moire.ultrasonic.domain.toDomainEntitiesList
import org.moire.ultrasonic.domain.toDomainEntity
import org.moire.ultrasonic.domain.toDomainEntityList
import org.moire.ultrasonic.domain.toMusicDirectoryDomainEntity
import org.moire.ultrasonic.util.CancellableTask
import org.moire.ultrasonic.util.FileUtil
import org.moire.ultrasonic.util.Util
import timber.log.Timber
@ -611,11 +610,9 @@ open class RESTMusicService(
@Throws(Exception::class)
override fun getDownloadInputStream(
context: Context,
song: MusicDirectory.Entry,
offset: Long,
maxBitrate: Int,
task: CancellableTask
maxBitrate: Int
): Pair<InputStream, Boolean> {
val songOffset = if (offset < 0) 0 else offset