Disable getVideoUrl() method.

This method uses some assuptions on endpoint urls.
The right way is to use stream() api call to get video stream.

Signed-off-by: Yahor Berdnikau <egorr.berd@gmail.com>
This commit is contained in:
Yahor Berdnikau 2017-11-19 22:10:34 +01:00
parent 7f5e04ebb2
commit 4b789e4c88
2 changed files with 9 additions and 24 deletions

View File

@ -110,7 +110,7 @@ public interface MusicService
*/
Pair<InputStream, Boolean> getDownloadInputStream(Context context, MusicDirectory.Entry song, long offset, int maxBitrate, CancellableTask task) throws Exception;
String getVideoUrl(Context context, String id, boolean useFlash) throws Exception;
@Deprecated String getVideoUrl(Context context, String id, boolean useFlash) throws Exception;
JukeboxStatus updateJukeboxPlaylist(List<String> ids, Context context, ProgressListener progressListener) throws Exception;

View File

@ -812,29 +812,14 @@ public class RESTMusicService implements MusicService {
return new Pair<>(response.getStream(), partial);
}
@Override
public String getVideoUrl(Context context, String id, boolean useFlash) throws Exception
{
StringBuilder builder = new StringBuilder(5);
if (useFlash)
{
builder.append(Util.getRestUrl(context, "videoPlayer"));
builder.append("&id=").append(id);
builder.append("&maxBitRate=500");
builder.append("&autoplay=true");
}
else
{
checkServerVersion(context, "1.9", "Video streaming not supported.");
builder.append(Util.getRestUrl(context, "stream"));
builder.append("&id=").append(id);
builder.append("&format=raw");
}
String url = rewriteUrlWithRedirect(context, builder.toString());
Log.i(TAG, String.format("Using video URL: %s", url));
return url;
}
@Override
public String getVideoUrl(Context context, String id, boolean useFlash) throws Exception {
// This method should not exists as video should be loaded using stream method
// Previous method implementation uses assumption that video will be available
// by videoPlayer.view?id=<id>&maxBitRate=500&autoplay=true, but this url is not
// official Subsonic API call.
throw new UnsupportedOperationException("This method is not longer supported");
}
@Override
public JukeboxStatus updateJukeboxPlaylist(List<String> ids,