Use Kodi's version stored on the DB instead of calling Kodi in the download subtitles option
This commit is contained in:
parent
a4945c8534
commit
4a8b2b4d43
|
@ -471,28 +471,12 @@ public class NowPlayingFragment extends Fragment
|
||||||
switch (which) {
|
switch (which) {
|
||||||
case 0:
|
case 0:
|
||||||
// Download subtitles. First check host version to see which method to call
|
// Download subtitles. First check host version to see which method to call
|
||||||
Application.GetProperties getProperties = new Application.GetProperties(Application.GetProperties.VERSION);
|
HostInfo hostInfo = hostManager.getHostInfo();
|
||||||
getProperties.execute(hostManager.getConnection(), new ApiCallback<ApplicationType.PropertyValue>() {
|
if (hostInfo.getKodiVersionMajor() < 13) {
|
||||||
@Override
|
showDownloadSubtitlesPreGotham();
|
||||||
public void onSuccess(ApplicationType.PropertyValue result) {
|
} else {
|
||||||
if (!isAdded()) return;
|
showDownloadSubtitlesPostGotham();
|
||||||
// Ok, we've got a version, decide which method to call
|
}
|
||||||
if (result.version.major < 13) {
|
|
||||||
showDownloadSubtitlesPreGotham();
|
|
||||||
} else {
|
|
||||||
showDownloadSubtitlesPostGotham();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onError(int errorCode, String description) {
|
|
||||||
if (!isAdded()) return;
|
|
||||||
// Something went wrong
|
|
||||||
Toast.makeText(getActivity(),
|
|
||||||
String.format(getString(R.string.error_getting_properties), description),
|
|
||||||
Toast.LENGTH_SHORT).show();
|
|
||||||
}
|
|
||||||
}, callbackHandler);
|
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
Input.ExecuteAction syncSubtitleAction = new Input.ExecuteAction(Input.ExecuteAction.SUBTITLEDELAY);
|
Input.ExecuteAction syncSubtitleAction = new Input.ExecuteAction(Input.ExecuteAction.SUBTITLEDELAY);
|
||||||
|
|
Loading…
Reference in New Issue